【发布时间】:2016-02-27 04:27:38
【问题描述】:
我有一个绘制一系列圆圈的图表,但是,由于轴不是圆形,而是椭圆形,如下图所示。我知道这是一个反复出现的问题,并且有很多这样的问题......但是我找不到任何对我有帮助的东西!我试过输入fig = plt.figure(0, figsize=(14.5, 1.75)),这确实有点帮助,但也许ax.set_aspect() 但是,使用标量也没有多大帮助!
对于这个情节,标有 *** 的线不存在
我的代码如下:
fig = plt.figure(0)
ax = fig.add_subplot(111)
ax.set_aspect(???)#*** not sure if this should be here or not
plt.axis([-5, 20, -1, 1])
circle1 = plt.Circle((-1,0.25), radius=0.2, color='c')
circle2= plt.Circle((4,-0.5), radius=0.5, color='m')
plt.gcf().gca().add_artist(circle1)
plt.gcf().gca().add_artist(circle2)
【问题讨论】:
标签: python matplotlib plot aspect-ratio