我想绘制一个椭圆。
ax = plt.subplot(111)
ellipse = Ellipse(mean1L, ellipse_x, ellipse_y, angle=theta)
ax.add_artist(ellipse)
plt.show()
每个论点似乎都很好,但它没有出现。我究竟做错了什么?
椭圆超出轴限制。
你宁愿使用而不是ax.add_artist(ellipse)
ax.add_patch(ellipse)
能够轻松调整轴限制到添加的补丁。这将允许稍后调用ax.autoscale_view()
自动调整轴限制。
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
ax = plt.subplot(111)
ellipse = Ellipse((2,2), 1,1.5 , angle=60)
ax.add_patch(ellipse)
ax.autoscale_view()
plt.show()