[Matplotlib-users] Plotting Arrows
I'd like to plot some arrows. I can use the pyplot.arrow function but it does not give an arrow head. I am trying to use FancyArrow in the following way: import matplotlib as mpl import matplotlib.pyplot as plt plt.figure(None) ax = plt.gca() arr = mpl.patches.FancyArrowPatch((0,0),(3,2),arrowstyle='simple') ax.add_patch(arr) plt.show() but I get "ValueError: Given lines do not intersect" in the bezier.py file. (Full traceback below) Thanks for any hints! Gus Traceback (most recent call last): File "M:\mypy\minimum.py", line 8, in ax.add_patch(arr) File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 1453, in add_patch self._update_patch_limits(p) File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 1469, in _update_patch_limits vertices = patch.get_path().vertices File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 3792, in get_path _path, fillable = self.get_path_in_displaycoord() File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 3822, in get_path_in_displaycoord self.get_mutation_aspect() File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 2845, in __call__ return self.transmute(path, mutation_size, linewidth) File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 3384, in transmute tail_left, tail_right = get_parallels(arrow_out, tail_width/2.) File "C:\Python26\lib\site-packages\matplotlib\bezier.py", line 359, in get_parallels c2x_left, c2y_left, cos_t2, sin_t2) File "C:\Python26\lib\site-packages\matplotlib\bezier.py", line 34, in get_intersection raise ValueError("Given lines do not intersect") ValueError: Given lines do not intersect -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] simpler example of embedding in wx
I'd like to offer a simplest possible example for embedding in wxPython; significantly simpler and completely pared down compared to either of the two that are shown here: http://www.scipy.org/Matplotlib_figure_in_a_wx_panel but I don't have access to modify the page. Doesn't anyone on the list have that access, and would that be welcome? My example is ~20 lines long. Thanks, Che -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] legend and bbox_to_anchor, and draggable()
Daniel Hyams writes: > I was playing around with draggable legends, and some strange things started > happening (exception down in the depths of beckend_agg.py, accompanied by a > long stack trace). To make a long story short, I can reproduce this in the > draggable_legend.py example on the matplotlib website. All you have to do > is change line 7 [...] to > > l = ax.legend(bbox_to_anchor=(.1,.1)) Apparently this creates a bounding box with zero width and height, which causes NaNs to appear in various transforms later on. It seems that you can get the same placement of the legend with l = ax.legend(bbox_to_anchor=(0,0,.1,.1)) which creates a non-degenerate bounding box that doesn't have this problem. A possibly simpler option is l = ax.legend(loc=(-0.2,0.1)) which sets the position of the lower-left corner of the legend box so you'll need to tweak the coordinates from what you used with bbox_to_anchor. > I'm sure that I'm not understanding the proper usage of > bbox_to_anchor. I'm not sure either. It seems that the two-number form of the bounding box is meant to create a degenerate bounding box so that any kind of location specifier ("upper right", "lower center", etc) will always hit that exact place, but perhaps naturally that makes it difficult to move the box around. -- Jouni K. Seppänen http://www.iki.fi/jks -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] "asynchronous" plots?
John Salvatier writes: > Is there a way to do "asynchronous" plots in matplotlib? By asynchronous I > mean plots that simply spawn a new process and do not stop the program while > the plot is visible? In 2007 Bill Baxter made a package called ezplot that does plots in a separate process via a remote procedure call interface. I don't think the project has been continued since, so it might not be compatible with current matplotlib, but it may be a useful starting point: http://www.billbaxter.com/projects/ezplot/ -- Jouni K. Seppänen http://www.iki.fi/jks -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users