|
From: Joe K. <jof...@gm...> - 2013-03-14 01:48:29
|
On Wed, Mar 13, 2013 at 3:22 PM, Jonathan Slavin <js...@cf...>wrote: > Nevermind on my earlier question on artists and using datacursor. I > figured that one out. What I did was basically (after creating the > image and contours): > > artist = gca().images > datacursor(artist) > > and it worked! > Glad it worked! For what it's worth, you can also do: im = imshow(yourdata) datacursor(im) It's a bit cleaner than getting the AxesImage through ax.images. Cheers! -Joe > Jon > > On Wed, 2013-03-13 at 15:50 -0400, Jonathan Slavin wrote: > > Joe, > > > > Thank you! I will especially use it to get the z value in images. I > > started to try to do something like this once but never finished. > > > > One thing I'm having a bit of trouble with is providing an artist as an > > argument. The reason I wanted to do that is to look only at the values > > for the image and not those for the contours drawn on the image. How > > does that work exactly? > > > > As a side note, I thought that I had found a bug because an I was > > looking at image would, in some places, print only the x and y values > > but not the z value. Then I realized it was printing the values for a > > contour that I had made invisible by setting its edgecolor to 'None'. > > This was because the contour created had two parts and I only wanted to > > show one of them. Anyone know a different way to do that? > > > > Regards, > > Jon > > > > On Tue, 2013-03-12 at 22:58 -0500, Joe Kington wrote: > > > I recently got around to polishing up a snippet I've been using for > > > quite awhile. https://github.com/joferkington/mpldatacursor/ and I > > > was hoping to get some feeding on the current implementation. > > > > > > > > > "mpldatacursor" allows a user to easily click on an artist and display > > > a customizable, interactive pop-up box displaying information about > > > the selected artist (e.g. x & y, label, z for images and collections, > > > etc). It's a stand-alone module (and in pypi), but you could also > > > just download the examples directory from github and copy the > > > mpldatacursor.py file into it to try things out. > > > > > > > > > A few key questions: > > > > > > 1. Is this something that anyone else finds useful? > > > > > > 2. Does it seem intuitive? > > > > > > 3. Does the implementation seem flexible enough for most needs? > > > (Note that any additional kwargs are passed on to annotate to > > > create the "data cursor", so the appearance of the box is > > > customizable through annotation kwargs.) > > > > > > 4. Are there any obvious features missing? > > > > > > 5. Any suggestions? (especially better name suggestions...) > > > > > > If it is something that other people find useful, I'd be happy to > > > submit a pull request to incorporate it into matplotlib. (If I did, > > > it would probably be best to drop the HighlightDataCursor class, as > > > its limited in what it can do.) > > > > > > Thanks a bunch! > > > > > > -Joe > > > > > > > > > > > > > -- > ______________________________________________________________ > Jonathan D. Slavin Harvard-Smithsonian CfA > js...@cf... 60 Garden Street, MS 83 > phone: (617) 496-7981 Cambridge, MA 02138-1516 > cell: (781) 363-0035 USA > ______________________________________________________________ > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_mar > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |