On Sun, Jun 22, 2008 at 3:18 AM, Paul Hartley <[EMAIL PROTECTED]> wrote:
>
> If I click on a bar that is part of a broken_barh collection which has its
> picker attribute enabled, there appears to be two events generated for
> example:
>
>     def on_pick(self, event):
>         print event.mouseevent.xdata
>         print event.mouseevent.ydata

I am not seeing this with the latest mpl.  Here is the example I am
using.  For future reference, if you post s complete, self-contained
example we're much more likely to be able to help quickly.  If I have
to write the example to see if there is a bug, I'm much more likely to
back-burner it.

from matplotlib.pyplot import figure, show

fig = figure()
ax = fig.add_subplot(111)
ax.broken_barh([ (110, 30), (150, 10) ] , (10, 9), picker=5)
ax.broken_barh([ (10, 50), (100, 20),  (130, 10)] , (20, 9),
                facecolors=('red', 'yellow', 'green'), picker=5)

ax.set_ylim(5,35)
ax.set_xlim(0,200)
ax.set_xlabel('seconds since start')
ax.set_yticks([15,25])
ax.set_yticklabels(['Bill', 'Jim'])
ax.grid(True)


def on_pick(event):
    print event.artist, event.mouseevent.xdata, event.mouseevent.ydata

fig.canvas.mpl_connect('pick_event', on_pick)
show()

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to