【发布时间】:2015-03-12 14:37:46
【问题描述】:
在Matlab中,绘图是这样制作的,原点在左上角,x轴在原点的南边为正,y轴在原点的东边为正; x 轴在左边距编号,y 轴在上边距标记。
figure();
set(gca,'YAxisLocation','Right','YDir','reverse')
axis([0 10 0 10]);
daspect([1,1,1])
grid on
view([-90 -90])
如何在 Python 中实现相同的功能?我继续这样:
import matplotlib.pyplot as plt
plt.figure(1)
plt.axis([40, 160, 0, 0.03])
plt.grid(True)
plt.show()
python 的等价物是什么:
set(gca,'YAxisLocation','Right','YDir','reverse')daspect([1,1,1])view([-90 -90])
编辑:
figure
set(gca,'YAxisLocation','right','XTick',0:15,'YDir','reverse')
axis([0 16 0 16]);
daspect([1,1,1])
hold on
text(2,8,'CHN');
text(8,2,'USA');
view([-90 -90])
输出是:
【问题讨论】:
标签: python matplotlib matlab-figure