Feedback on an implementation of a matlab-ish "datacursor"

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

Thanks for this Joe, mpldatacursor looks like an excellent piece of work - I for one will be installing and using it regularly.

Thanks for sharing!

···

On 13 March 2013 03:58, Joe Kington <joferkington@…287…> 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


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

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

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:

Is this something that anyone else finds useful?

Yes, I had tried out your previous snippet.
I thought it would make a nice way to get the labels for an outlier
plot, when there are too many points to add the labels to the plot.
(statsmodels didn't have an outlier plot or calculations at the time.)

Thanks for the snippets.

Josef

···

On Tue, Mar 12, 2013 at 11:58 PM, Joe Kington <joferkington@...287...> wrote:

Does it seem intuitive?

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.)

Are there any obvious features missing?

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

------------------------------------------------------------------------------
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

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
jslavin@...1081... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
cell: (781) 363-0035 USA
______________________________________________________________

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!

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
jslavin@...1081... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
cell: (781) 363-0035 USA
______________________________________________________________

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

···

On Wed, Mar 13, 2013 at 3:22 PM, Jonathan Slavin <jslavin@...1081...>wrote:

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
jslavin@...1081... 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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users