I got the example working (svn diff below).  Should Collection objects 
have a set_offsets method?
-Ryan


Index: dynamic_collection.py
===================================================================
--- dynamic_collection.py       (revision 5020)
+++ dynamic_collection.py       (working copy)
@@ -34,6 +34,8 @@
          color = cm.jet(rand())
          offsets.append((x,y))
          facecolors.append(color)
+        collection._offsets = offsets
+        collection.set_facecolors(facecolors)
          fig.canvas.draw()
      elif event.key=='d':
          N = len(offsets)
@@ -41,6 +43,8 @@
              ind = random.randint(0,N-1)
              offsets.pop(ind)
              facecolors.pop(ind)
+            collection._offsets = offsets
+            collection.set_facecolors(facecolors)
              fig.canvas.draw()

  fig.canvas.mpl_connect('key_press_event', onpress)



> Hi,
> I tried to run the dynamic_collections.py example in the source
> directory (SVN revision 5002) but got the following error:
> 
> Traceback (most recent call last):
> File "dynamic_collection.py", line 23, in <module>
> transOffset = ax.transData,
> TypeError: __init__() got multiple values for keyword argument 'numsides'
> 
> I removed the numsides=5 keyword argument (line 16) from
> dynamic_collections.py, and while it lets the example run without error,
> the "dynamic" aspect doesn't work. That is, the initial plot with a
> single point appears but pressing 'a' or 'd' does nothing (when it
> should add or delete a point).
> 
> Any ideas on how to get this working?
> 
> thanks,
> -Ryan 





-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to