SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: sunzen w. <su...@gm...> - 2007年10月26日 07:08:19
Hi Gurus,
 I'm new to matplotlib programming, and get puzzled about designing
picking handler for broken_barh by the OO interface.
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):
Could you give me any guidance?
-- 
sunzen
<<freedom & enjoyment>>
From: sunzen w. <su...@gm...> - 2007年10月26日 07:22:50
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>>
From: sunzen w. <su...@gm...> - 2007年10月31日 03:05:09
Just for information, i change from broken_barh to just barh, so as to
easily set picker property. It satisfies my needs now.
Just for exploration, does anyone know how to implement it by using
broken_barh()?
On 10/26/07, sunzen w. <su...@gm...> wrote:
>
> 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.
>
>
> --
sunzen
<<freedom & enjoyment>>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /