Hi Gurus,
  (I'm sorry for sending the above unfinished one)
   I'm new to matplotlib programming, and get puzzled about designing
picking handler for broken_barh by the OO interface.
   Could you give me any guidance? Any your help will be appreciated.

<P.S.>
My current approach is presented as the following:
1. plot broken_barh and set picker
   pcol = axes.broken_barh(xseq, yseq, facecolors = colors)
   pcol.set_picker(True)
2. Design picking handler
   mycanvas.mpl_connect('pick_event', foo_pick)
   .....
   def foo_pick(self, event):
         if isinstance(event.artist, BrokenBarHCollection):
           ....
But it doesn't work as expected, and the following error message are
printed.
~~~~~~
verts N=2, Nverts=2 [[(Decimal("1184851021.054456271"), 0.5),
(Decimal("1184851021.054456271"), 1.5),
(Decimal("1184851021.280959577"), 1.5),
(Decimal("1184851021.280959577"), 0.5)],
[(Decimal("1184851021.280959577"), 0.5),
(Decimal("1184851021.280959577"), 1.5),
(Decimal("1184851024.851673542"), 1.5),
(Decimal("1184851024.851673542"), 0.5)]]
offsets; Noffsets=0
i%Nverts=0
Traceback (most recent call last):
 File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 146, in button_press_event
   FigureCanvasBase.button_press_event(self, x, y, event.button)
 File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py", line
914, in button_press_event
   self.figure.pick(mouseevent)
 File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line 176, in
pick
   a.pick(mouseevent)
 File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 1763, in
pick
   a.pick(mouseevent)
 File "/usr/lib/python2.5/site-packages/matplotlib/collections.py",
line 155, in pick
   for i, thispoly in
enumerate(self.get_transformed_patches()):
 File "/usr/lib/python2.5/site-packages/matplotlib/collections.py", line
188, in get_transformed_patches
   if any(isnan(polyverts)):
TypeError: function not supported for these types, and can't coerce safely
to supported types

~~~~~~
My machine environment  is:
fedora 7;  python-2.5; matplotlib 0.90
-- 
sunzen
<<freedom & enjoyment>>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to