(13/05/2012 02:52), Arek Kędzior: > What I am trying is to plot multiple discontinuous lines. > I know that this approach does not work very well. How about > using LineCollection. > Put all curves into line collection > Use Pick event to get line segment (what function to use ?) > Once I have line segment, get xdata, ydata corresponding to line > segment (what function to use ?) Why don't you use:
picker=myTest in your ax.plot, where def myTest(artist,mousevnt): ... return (hit,kwdict) performs any test you like? Again, this is called separately for every Artist belonging to the Usual Suspects, but you may control whether this is the first line found, then your program just computes the distance, or the second one, then it computes the distance, and discriminates between the two. The properties kwdict passed to your callback will permit to do the rest. Or, perhaps, the first time the test doesn't do anything, and returns False, and the second time computes both distances, and finds the minimum. You have your "private" access to both lines anyway. The generalization to many lines should be straightforward. Jerzy K. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users