我希望使用matplotlib.patches.Ellipse
函数获取get_verts()
对象的顶点。不幸的是,在将椭圆添加到Axes
之后,顶点已被更改。这是我的代码(Python 3.5):
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.patches import Ellipse
fig = Figure()
ax = fig.add_subplot(111, aspect='equal')
e = Ellipse((0,0), 100, 200)
print(e.get_verts())
[[ 0. -100. ]
[ 2.48205003 -99.91768257]
[ 7.38744659 -98.94347052]
...,
[ -7.38744659 -98.94347052]
[ -2.48205003 -99.91768257]
[ 0. -100. ]]
ax.add_patch(e)
print(e.get_verts())
[[ 8.00000000e+01 -3.83520000e+04]
[ 1.57066457e+02 -3.83518765e+04]
[ 3.11115446e+02 -3.83503961e+04]
...,
[ -1.51115446e+02 -3.83503961e+04]
[ 2.93354282e+00 -3.83518765e+04]
[ 8.00000000e+01 -3.83520000e+04]]
有没有人理解这个和/或知道如何获得原始顶点(在将椭圆添加到轴之前)?