Python Matplotlib中的圆心面片

Python Matplotlib中的圆心面片,python,matplotlib,Python,Matplotlib,我已经在Matplotlib中创建了一组圆形面片。我需要找一份工作 这些圆面片的中心列表,用于某些计算 在圆形修补程序的文档页面上(请参见第页的matplotlib.patches.circle),似乎没有任何提取圆心的方法,例如在mycircle.get\u center中。半径有一个,但中心没有。有什么建议吗 编辑: 下面是一些代码。基本上,我想做的是创建一个交互式应用程序,用户在其中用鼠标点击一些磁盘 屏幕。定位这些磁盘的唯一限制是它们 应该是不相交的。因此,当用户试图用鼠标点击插入磁盘时

我已经在Matplotlib中创建了一组圆形面片。我需要找一份工作 这些圆面片的中心列表,用于某些计算

在圆形修补程序的文档页面上(请参见第页的matplotlib.patches.circle),似乎没有任何提取圆心的方法,例如在
mycircle.get\u center
中。半径有一个,但中心没有。有什么建议吗

编辑:

下面是一些代码。基本上,我想做的是创建一个交互式应用程序,用户在其中用鼠标点击一些磁盘 屏幕。定位这些磁盘的唯一限制是它们 应该是不相交的。因此,当用户试图用鼠标点击插入磁盘时,我想检查新磁盘是否与已输入的磁盘相交

我将所有圆形补丁存储在一个名为
disk\u arrangement
的数组中。 当然,我可以创建一个单独的阵列来记录这些中心来完成我的工作, 但这看起来很难看。这就是为什么我希望Matplotlib作为一种方法来提取给定圆面片的中心

def place_disk(event, disk_arrangement=[] ):

    def is_inside_an_existing_disk(center_x, center_y):
      if disk_arrangement != []:
        for existing_disk in disk_arrangement:
            if existing_disk.contains(event): #### How to do this????
               return True 
      return False

    if event.name     == 'button_press_event' and \
       event.dblclick == True                 and \
       event.xdata    != None                 and \
       event.ydata    != None                 and \
       is_inside_an_existing_disk(event.xdata,event.ydata) == False :  
              cursor_circle = mpl.patches.Circle((event.xdata,
                                                  event.ydata),
                                                  radius=0.3,
                                                  facecolor= 'green')
              disk_arrangement.append(cursor_circle)
              ax.add_patch(cursor_circle)
              fig.canvas.draw()

我正在Ubuntu 14.04上使用Python 2.7.11,请尝试使用
center
属性,例如,对于初始化为以下内容的修补程序:

from matplotlib.patches import Circle    
circ = Circle((1, 2), radius=1)
circ.center == (1,2) #should return True

要确定对象的所有属性,可以使用
dir
,例如
dir(circ)
提供
circ
对象的所有属性,包括
center
radius
等。

定义面片时,您不是提供了中心的坐标吗?一个最简单的工作示例是useful@nluigi请参见编辑。谢谢