在向Axes添加补丁后,Matplotlib补丁`get_verts()`发生了变化

时间:2016-05-31 10:24:12

标签: python python-3.x matplotlib

我希望使用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]]

有没有人理解这个和/或知道如何获得原始顶点(在将椭圆添加到轴之前)?

0 个答案:

没有答案