1

I have tho following issue: i have two Numpy arrays containing the x,y coordinates of many (potentiality, tens of thousand) of disks, whose (different) radii are contained in a third array r. Both the radii and the coordinates are measured with the same units. I would like to plot them with the exact radius given by r but in a fast way.

I have found some partial solutions (Matplotlib scatter can use the three arrays and it is reasonably fast, but the size is scale in points, the Circles instances are too slow and Mayavi is in my opinion an overkill since the problem is 2d).

The speed is important due to the large number of circles I want to plot. Is there a simple native solution that did not come to my mind?

Francesco Turci
  • 817
  • 1
  • 9
  • 17
  • 2
    Did you try using a collection in matplotlib this is usually much faster. See for example in this answer http://stackoverflow.com/questions/6028675/setting-color-range-in-matplotlib-patchcollection – jrsm Jun 16 '15 at 09:40
  • It is not bad, thank you. But isn't the for loop a problem when I want thousands of disks to be plotted? – Francesco Turci Jun 16 '15 at 11:11
  • The for loop creates a list of patches which are than used to create the collection object by itself i think, so the ploting should be faster. I once had a problem where I had to plot like thousend of lines and using a LineCollection made it much faster. – jrsm Jun 17 '15 at 09:16

0 Answers0