You can subscribe to this list here.
2003 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}
(3) 
_{Jun}

_{Jul}

_{Aug}
(12) 
_{Sep}
(12) 
_{Oct}
(56) 
_{Nov}
(65) 
_{Dec}
(37) 

2004 
_{Jan}
(59) 
_{Feb}
(78) 
_{Mar}
(153) 
_{Apr}
(205) 
_{May}
(184) 
_{Jun}
(123) 
_{Jul}
(171) 
_{Aug}
(156) 
_{Sep}
(190) 
_{Oct}
(120) 
_{Nov}
(154) 
_{Dec}
(223) 
2005 
_{Jan}
(184) 
_{Feb}
(267) 
_{Mar}
(214) 
_{Apr}
(286) 
_{May}
(320) 
_{Jun}
(299) 
_{Jul}
(348) 
_{Aug}
(283) 
_{Sep}
(355) 
_{Oct}
(293) 
_{Nov}
(232) 
_{Dec}
(203) 
2006 
_{Jan}
(352) 
_{Feb}
(358) 
_{Mar}
(403) 
_{Apr}
(313) 
_{May}
(165) 
_{Jun}
(281) 
_{Jul}
(316) 
_{Aug}
(228) 
_{Sep}
(279) 
_{Oct}
(243) 
_{Nov}
(315) 
_{Dec}
(345) 
2007 
_{Jan}
(260) 
_{Feb}
(323) 
_{Mar}
(340) 
_{Apr}
(319) 
_{May}
(290) 
_{Jun}
(296) 
_{Jul}
(221) 
_{Aug}
(292) 
_{Sep}
(242) 
_{Oct}
(248) 
_{Nov}
(242) 
_{Dec}
(332) 
2008 
_{Jan}
(312) 
_{Feb}
(359) 
_{Mar}
(454) 
_{Apr}
(287) 
_{May}
(340) 
_{Jun}
(450) 
_{Jul}
(403) 
_{Aug}
(324) 
_{Sep}
(349) 
_{Oct}
(385) 
_{Nov}
(363) 
_{Dec}
(437) 
2009 
_{Jan}
(500) 
_{Feb}
(301) 
_{Mar}
(409) 
_{Apr}
(486) 
_{May}
(545) 
_{Jun}
(391) 
_{Jul}
(518) 
_{Aug}
(497) 
_{Sep}
(492) 
_{Oct}
(429) 
_{Nov}
(357) 
_{Dec}
(310) 
2010 
_{Jan}
(371) 
_{Feb}
(657) 
_{Mar}
(519) 
_{Apr}
(432) 
_{May}
(312) 
_{Jun}
(416) 
_{Jul}
(477) 
_{Aug}
(386) 
_{Sep}
(419) 
_{Oct}
(435) 
_{Nov}
(320) 
_{Dec}
(202) 
2011 
_{Jan}
(321) 
_{Feb}
(413) 
_{Mar}
(299) 
_{Apr}
(215) 
_{May}
(284) 
_{Jun}
(203) 
_{Jul}
(207) 
_{Aug}
(314) 
_{Sep}
(321) 
_{Oct}
(259) 
_{Nov}
(347) 
_{Dec}
(209) 
2012 
_{Jan}
(322) 
_{Feb}
(414) 
_{Mar}
(377) 
_{Apr}
(179) 
_{May}
(173) 
_{Jun}
(234) 
_{Jul}
(151) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 






1
(28) 
2
(11) 
3
(15) 
4
(11) 
5
(13) 
6
(33) 
7
(13) 
8
(9) 
9
(2) 
10
(9) 
11
(27) 
12
(5) 
13
(10) 
14
(6) 
15
(9) 
16
(4) 
17
(2) 
18
(19) 
19
(11) 
20
(9) 
21
(16) 
22
(16) 
23
(5) 
24
(2) 
25
(8) 
26
(2) 
27
(11) 
28
(10) 
29
(5) 
30
(1) 
31
(2) 






From: Lisa Tauxe <ltauxe@uc...>  20080822 22:09:37

I've installed the Enthought Python Distribution for Mac OS on my MacOS 10.4 Intel machine. when i try to install basemap0.99.1 I get this error: gcc: unrecognized option 'nocppprecomp' cc1: error: unrecognized command line option "mnofusedmadd" cc1: error: unrecognized command line option "arch" cc1: error: unrecognized command line option "arch" cc1: error: unrecognized command line option "Wnolongdouble" error: Command "gcc arch ppc arch i386 isysroot /Developer/SDKs/ MacOSX10.4u.sdk fnostrictaliasing Wnolongdouble nocppprecomp mnofusedmadd fnocommon dynamic DNDEBUG g O3 Isrc I/Library/ Frameworks/Python.framework/Versions/4.0.30001/lib/python2.5/site packages/numpy1.1.1.0001py2.5macosx10.3fat.egg/numpy/core/ include I/Library/Frameworks/Python.framework/Versions/4.0.30001/ include/python2.5 c src/PJ_gn_sinu.c o build/temp.macosx10.3 i3862.5/src/PJ_gn_sinu.o" failed with exit status 1 Any ideas? lisa tauxe 
From: JaeJoon Lee <lee.j.joon@gm...>  20080822 21:43:06

Hi Jason, I did made a similar class sometime ago and I'm attaching it just in case. I guess it is very similar to yours but I rely on matplolib.patches.FancyArrow class to draw the arrow head. The circle drawn by scatter() command should be a circle with size s (the third argument of the scatter command) in points . It seems that it is implemented as a unit circle centered at (0,0) with a transform corresponding to the size s (and offset). So you may try something like below to calculate the size of the circle in data coord. ax = gca() p = scatter([0],[0], 500.) tr = p.get_transforms()[0] + ax.transData.inverted() x1, y1 = tr.transform_point([0,0]) x2, y2 = tr.transform_point([1,0]) r = abs(x2  x1) p is a collection object and p.get_transforms() is a list of transforms. Note that a circle in the canvas coordinate(?) can be an ellipse in data coordinates. So, I guess you'd better do things in the canvas coordinates. For shortening your path, if you're only concerned with a straight line, it should be straight forward. But I guess it would a bit tricky to do this for general bezier curves (as in the example that Alan linked). I think (but I may be wrong) there is no universal algorithm to find the "all" intersecting points of two bezier curves. There may be one for between a bezier curve and a circle. And in this case where one point is inside the circle and the other is outside, one simple way I can think of is to recursively bisect the bezier curve (similar to the bisect root finding). Regards, JJ On Fri, Aug 22, 2008 at 12:15 PM, Alan G Isaac <aisaac@...> wrote: > Jason Grout wrote: >> The other problem is a more serious problem for me: how do >> I shorten the line so that it goes between the boundaries >> of the circle instead of the centers, especially when the >> circles are constructed in a scatter plot. > > Some years back I briefly tried to think about arrows and > I found it trickier than expected. Note that some famous > software clearly does arrows wrong. (E.g., gnuplot, at > least last I checked.) > > Example: you have decided that you want to draw to the edge > of a point, but a) is that right and b) can it be reasonably > implemented? > > a) One might well argue in many applications that the arrow > tip should go to the center of the circle. > > b) I'm not sure. > > But surely somebody out there will offer some great clues. > Perhaps along the line of graphviz: > http://www.graphviz.org/Gallery/directed/fsm.html > > Really this is not an answer to your questions ... > > Cheers, > Alan Isaac > > > >  > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblincontest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > 
From: Jason Grout <jasonsage@cr...>  20080822 21:41:01

Alan G Isaac wrote: > Jason Grout wrote: >> The other problem is a more serious problem for me: how do >> I shorten the line so that it goes between the boundaries >> of the circle instead of the centers, especially when the >> circles are constructed in a scatter plot. > > Some years back I briefly tried to think about arrows and > I found it trickier than expected. Note that some famous > software clearly does arrows wrong. (E.g., gnuplot, at > least last I checked.) > > Example: you have decided that you want to draw to the edge > of a point, but a) is that right and b) can it be reasonably > implemented? > > a) One might well argue in many applications that the arrow > tip should go to the center of the circle. I'm sure there are lots of applications where this is true. My specific problem domain is drawing graphs, exactly as graphviz. Often there is a label inside the circle. Drawing to the edge of the circle is the standard way of doing it, so a) is yes, it is the right thing to do. Things like flowcharts are another example of wanting to do this. > > b) I'm not sure. Thanks; at least this is validating the amount of time I already spent thinking about this and trying to get it to work. > > But surely somebody out there will offer some great clues. > Perhaps along the line of graphviz: > http://www.graphviz.org/Gallery/directed/fsm.html > > Really this is not an answer to your questions ... Thanks for your comments. I think I'll post up another post asking some more specific questions, along the lines of what I think might work if I can figure out what matplotlib is thinking. Jason 
From: Michael Droettboom <mdroe@st...>  20080822 20:43:21

Can you provide a standalone script to illustrate this problem? I suspect that the position of the text is somehow negative and is getting masked away by the log transformation (which is obviously undefined for negative numbers). Also, have you tried the GtkAgg backend instead? That sees a lot more usage, and therefore may not contain this bug. That said, this case should be handled correctly and probably requires a check. I'm away from the office and won't be able to look into this further until next week. Cheers, Mike 
From: Jeff Whitaker <jswhit@fa...>  20080822 20:35:09

Eric Firing wrote: > Jeff Whitaker wrote: >> Michael Roettger wrote: >>> Hi all, >>> >>> maybe I've misunderstood something concerning masking or quiver plots: >>> I want to exclude some data from a quiver plot. Here's an example: >>> >>> 8< >>> import numpy as N >>> import pylab as pl >>> import matplotlib.numerix.ma as ma >>> >>> # prepare data >>> X,Y = pl.meshgrid(range(5),range(5)) >>> angles = pl.rand(5,5) >>> U = N.cos(angles) >>> V = N.sin(angles) >>> >>> # prepare mask >>> M = N.zeros((5,5), dtype='bool') >>> M[2,2] = True >>> >>> # apply mask >>> Um = ma.masked_array(U,mask=M) >>> Vm = ma.masked_array(V,mask=M) >>> >>> # plot >>> pl.quiver(X,Y,Um,Vm) >>> # pl.plot(range(5),Um[2],'x') >>> >>> pl.show() >>> >8 >>> >>> Using the commented 'plot' command works as expected, but 'quiver' >>> results in >>> empty axes. If I take U,V instead of Um,Vm, the arrows are drawn .. >>> What am I doing wrong or is there another way to exclude arrows from >>> being >>> plotted? >>> >>> Thank you in advance, >>> >>> Michael >>> >>> >> >> Michael: I've fixed this now in svn. If you don't want to update to >> svn trunk, you can make this simple change in quiver.py > > Jeff, > > Thanks for the quick fixit will help for now, and will work in most > use cases, but it is not actually correct in general. The problem is > that quiver supports input of changed values of U, V, and C on the > existing X, Y grid, and these changed values can be masked arrays with > different points masked. (See Quiver.set_UVC().) That is why I did not > use delete_masked_points in the first place. Masked values used to be > handled correctly; I suspect the bug is actually in collections, not > in quiver itself. I can't track it down right now, but may be able to > look at it over the weekend. > > Eric OK Eric  I figured you'd chime in when you got a chance. Let's consider it a temporary workaround then. BTW: I updated the quiver_demo.py example to test the masking. Jeff > >> >>  lib/matplotlib/quiver.py (revision 6046) >> +++ lib/matplotlib/quiver.py (working copy) >> @@ 334,6 +334,12 @@ >> def __init__(self, ax, *args, **kw): >> self.ax = ax >> X, Y, U, V, C = self._parse_args(*args) >> + if C is not None: >> + X, Y, U, V, C = >> delete_masked_points(X.ravel(),Y.ravel(),U.ravel(), >> + V.ravel(),C.ravel()) >> + else: >> + X, Y, U, V = >> delete_masked_points(X.ravel(),Y.ravel(),U.ravel(), >> + V.ravel()) >> self.X = X >> self.Y = Y >> self.XY = np.hstack((X[:,np.newaxis], Y[:,np.newaxis])) >> >> >> Jeff >> >  Jeffrey S. Whitaker Phone : (303)4976313 Meteorologist FAX : (303)4976449 NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@... 325 Broadway Office : Skaggs Research Cntr 1D113 Boulder, CO, USA 803033328 Web : http://tinyurl.com/5telg 
From: Eric Firing <efiring@ha...>  20080822 19:32:19

Jeff Whitaker wrote: > Michael Roettger wrote: >> Hi all, >> >> maybe I've misunderstood something concerning masking or quiver plots: >> I want to exclude some data from a quiver plot. Here's an example: >> >> 8< >> import numpy as N >> import pylab as pl >> import matplotlib.numerix.ma as ma >> >> # prepare data >> X,Y = pl.meshgrid(range(5),range(5)) >> angles = pl.rand(5,5) >> U = N.cos(angles) >> V = N.sin(angles) >> >> # prepare mask >> M = N.zeros((5,5), dtype='bool') >> M[2,2] = True >> >> # apply mask >> Um = ma.masked_array(U,mask=M) >> Vm = ma.masked_array(V,mask=M) >> >> # plot >> pl.quiver(X,Y,Um,Vm) >> # pl.plot(range(5),Um[2],'x') >> >> pl.show() >> >8 >> >> Using the commented 'plot' command works as expected, but 'quiver' results in >> empty axes. If I take U,V instead of Um,Vm, the arrows are drawn .. >> What am I doing wrong or is there another way to exclude arrows from being >> plotted? >> >> Thank you in advance, >> >> Michael >> >> > > Michael: I've fixed this now in svn. If you don't want to update to > svn trunk, you can make this simple change in quiver.py Jeff, Thanks for the quick fixit will help for now, and will work in most use cases, but it is not actually correct in general. The problem is that quiver supports input of changed values of U, V, and C on the existing X, Y grid, and these changed values can be masked arrays with different points masked. (See Quiver.set_UVC().) That is why I did not use delete_masked_points in the first place. Masked values used to be handled correctly; I suspect the bug is actually in collections, not in quiver itself. I can't track it down right now, but may be able to look at it over the weekend. Eric > >  lib/matplotlib/quiver.py (revision 6046) > +++ lib/matplotlib/quiver.py (working copy) > @@ 334,6 +334,12 @@ > def __init__(self, ax, *args, **kw): > self.ax = ax > X, Y, U, V, C = self._parse_args(*args) > + if C is not None: > + X, Y, U, V, C = > delete_masked_points(X.ravel(),Y.ravel(),U.ravel(), > + V.ravel(),C.ravel()) > + else: > + X, Y, U, V = > delete_masked_points(X.ravel(),Y.ravel(),U.ravel(), > + V.ravel()) > self.X = X > self.Y = Y > self.XY = np.hstack((X[:,np.newaxis], Y[:,np.newaxis])) > > > Jeff > 
From: Jeff Whitaker <jswhit@fa...>  20080822 19:21:31

Michael Roettger wrote: > Hi all, > > maybe I've misunderstood something concerning masking or quiver plots: > I want to exclude some data from a quiver plot. Here's an example: > > 8< > import numpy as N > import pylab as pl > import matplotlib.numerix.ma as ma > > # prepare data > X,Y = pl.meshgrid(range(5),range(5)) > angles = pl.rand(5,5) > U = N.cos(angles) > V = N.sin(angles) > > # prepare mask > M = N.zeros((5,5), dtype='bool') > M[2,2] = True > > # apply mask > Um = ma.masked_array(U,mask=M) > Vm = ma.masked_array(V,mask=M) > > # plot > pl.quiver(X,Y,Um,Vm) > # pl.plot(range(5),Um[2],'x') > > pl.show() > >8 > > Using the commented 'plot' command works as expected, but 'quiver' results in > empty axes. If I take U,V instead of Um,Vm, the arrows are drawn .. > What am I doing wrong or is there another way to exclude arrows from being > plotted? > > Thank you in advance, > > Michael > > Michael: I've fixed this now in svn. If you don't want to update to svn trunk, you can make this simple change in quiver.py  lib/matplotlib/quiver.py (revision 6046) +++ lib/matplotlib/quiver.py (working copy) @@ 334,6 +334,12 @@ def __init__(self, ax, *args, **kw): self.ax = ax X, Y, U, V, C = self._parse_args(*args) + if C is not None: + X, Y, U, V, C = delete_masked_points(X.ravel(),Y.ravel(),U.ravel(), + V.ravel(),C.ravel()) + else: + X, Y, U, V = delete_masked_points(X.ravel(),Y.ravel(),U.ravel(), + V.ravel()) self.X = X self.Y = Y self.XY = np.hstack((X[:,np.newaxis], Y[:,np.newaxis])) Jeff  Jeffrey S. Whitaker Phone : (303)4976313 Meteorologist FAX : (303)4976449 NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@... 325 Broadway Office : Skaggs Research Cntr 1D113 Boulder, CO, USA 803033328 Web : http://tinyurl.com/5telg 
From: Alan G Isaac <aisaac@am...>  20080822 16:16:02

Jason Grout wrote: > The other problem is a more serious problem for me: how do > I shorten the line so that it goes between the boundaries > of the circle instead of the centers, especially when the > circles are constructed in a scatter plot. Some years back I briefly tried to think about arrows and I found it trickier than expected. Note that some famous software clearly does arrows wrong. (E.g., gnuplot, at least last I checked.) Example: you have decided that you want to draw to the edge of a point, but a) is that right and b) can it be reasonably implemented? a) One might well argue in many applications that the arrow tip should go to the center of the circle. b) I'm not sure. But surely somebody out there will offer some great clues. Perhaps along the line of graphviz: http://www.graphviz.org/Gallery/directed/fsm.html Really this is not an answer to your questions ... Cheers, Alan Isaac 
From: Jason Grout <jasonsage@cr...>  20080822 15:51:11

Alan G Isaac wrote: > Jason Grout wrote: >> Another related issue is that width of the path used to draw the >> arrowhead makes the arrow tip go beyond the endpoint; is there a way to >> shorten a line by a certain number of points so that we >> can account for that? > > For this problem, what you want is to fill the arrowhead > without stroking it. > Brilliant! Thanks for the suggestion. The other problem is a more serious problem for me: how do I shorten the line so that it goes between the boundaries of the circle instead of the centers, especially when the circles are constructed in a scatter plot. If I knew how big the circles were in plot coordinates, it wouldn't be a problem. But the circle size isn't specified in plot coordinates, but in scaleindependent coordinates, I believe. Is there a way I could somehow compute the intersections of the paths? Maybe while I draw the line, I could also construct a circle of the right size at the endpoint, ask for the intersection, and shorten my line to go there? Thanks again! Jason 
From: Alan G Isaac <aisaac@am...>  20080822 15:21:47

Jason Grout wrote: > Another related issue is that width of the path used to draw the > arrowhead makes the arrow tip go beyond the endpoint; is there a way to > shorten a line by a certain number of points so that we > can account for that? For this problem, what you want is to fill the arrowhead without stroking it. Cheers, Alan Isaac 
From: Jeff Whitaker <jswhit@fa...>  20080822 12:08:52

Zane Selvans wrote: > I'm drawing several hundred lines at a time, each consisting of 10100 > points, and it takes a couple of minutes for them all to display, > which makes me think I must be doing something stupid. > > The function that does the drawing looks like this: > > def plotlinmap(lins, map=None): > if map is None: > map = Basemap() > > map.drawmapboundary(fill_color="white") > map.drawmeridians(range(180,181,30)), labels=[1,0,0,1]) > map.drawparallels(range(90,91,30)), labels=[1,0,0,1]) > > for lin in lins: > x,y = map(degrees(lin.longitudes()),degrees(lin.latitudes())) > map.plot(x,y) > > return(map) > > It displays one line at a time, whenever map.plot() is called. Really > I'd like it to just do all the drawing at the end (assuming that would > make the whole process much faster). Is there some way to cleanly > pass map.plot() a big list of lines to draw? I'm sure there is and > I'm just being dense. Argh. > >  > Zane Selvans > Amateur Earthling > http://zaneselvans.org > zane@... > 303/8156866 > PGP Key: 55E0815F > > Zane: You can set up a LineCollection like this lcoll = LineCollection(segments) then add it to the current axes ax = pylab.gca() ax.add_collection(lcoll) (instead of using the Basemap plot method). To make sure the map axes are rescaled properly, you may need to do map.set_axes_limits() afterwards. See the line_collection.py pylab example for more details. Jeff  Jeffrey S. Whitaker Phone : (303)4976313 NOAA/OAR/CDC R/PSD1 FAX : (303)4976449 325 Broadway Boulder, CO, USA 803053328 
From: Jeff Whitaker <jswhit@fa...>  20080822 12:01:38

Michael Roettger wrote: > Hi all, > > maybe I've misunderstood something concerning masking or quiver plots: > I want to exclude some data from a quiver plot. Here's an example: > > 8< > import numpy as N > import pylab as pl > import matplotlib.numerix.ma as ma > > # prepare data > X,Y = pl.meshgrid(range(5),range(5)) > angles = pl.rand(5,5) > U = N.cos(angles) > V = N.sin(angles) > > # prepare mask > M = N.zeros((5,5), dtype='bool') > M[2,2] = True > > # apply mask > Um = ma.masked_array(U,mask=M) > Vm = ma.masked_array(V,mask=M) > > # plot > pl.quiver(X,Y,Um,Vm) > # pl.plot(range(5),Um[2],'x') > > pl.show() > >8 > > Using the commented 'plot' command works as expected, but 'quiver' results in > empty axes. If I take U,V instead of Um,Vm, the arrows are drawn .. > What am I doing wrong or is there another way to exclude arrows from being > plotted? > > Thank you in advance, > > Michael > Michael: With 0.98.3, all the arrows are drawn  I don't see empty axes. However, the masked elements are not excluded, so I do think it's a bug. Jeff  Jeffrey S. Whitaker Phone : (303)4976313 NOAA/OAR/CDC R/PSD1 FAX : (303)4976449 325 Broadway Boulder, CO, USA 803053328 
From: Jason Grout <jasonsage@cr...>  20080822 10:05:13

I'm trying to get some "pretty" arrows for graphs and other uses in Sage. One of the problems we've been having with the FancyArrow and YAArrow is that the arrow is skewed when the aspect ratio is not 1:1 and it is scaled along with the plot. I've written the attached ArrowLine class which basically modifies the marker drawing code to draw an arrowhead at the end of a Line2D. It doesn't suffer either of these problems; it works beautifully. However, in drawing (vertex and line) graphs, we have another problem. The vertices of the graph are drawn using scatterplot, and I know the corresponding vertex size (in whatever units scatterplot uses). I'd like to draw an arrow between the boundaries of the vertices. Is there a way to shorten a line that originally goes between the centers of two circles so that the line instead goes between the two boundaries of the circles? Note that clipping the line isn't an option since I want to keep the arrowhead on the line instead of clipping it off. I presume this shortening will have to be done in the drawing routine since it needs to be independent of zooming since the circles are drawn the same independent of zooming. Another related issue is that width of the path used to draw the arrowhead makes the arrow tip go beyond the endpoint; is there a way to shorten a line by a certain number of points so that we can account for that? Also, in drawing the arrowhead, the line pokes through the arrowhead; I'd like to shorten the shaft to the beginning of the arrowhead. I think all three of these shortening questions are similar; I'd like to shorten an arrow in a scaleindependent way (i.e., by a certain number of points or something). The code I have for the ArrowLine class is below. If people are interested, I could (eventually, as I have time) incorporate this functionality into the Line2D class (i.e., putting arrowheads on the ends of lines). r""" A matplotlib subclass to draw an arrowhead on a line. AUTHORS:  Jason Grout (20080819): initial version """ ############################################################################ # Copyright (C) 2008 Jason Grout <jasonsage@...> # Released under the terms of the modified BSD License ############################################################################ import matplotlib from matplotlib.path import Path from matplotlib.lines import Line2D import math import matplotlib.cbook class ArrowLine(Line2D): """ A matplotlib subclass to draw an arrowhead on a line. EXAMPLE: sage: import pylab sage: fig = pylab.figure() sage: ax = fig.add_subplot(111, autoscale_on=False) sage: t = [1,2] sage: s = [0,1] sage: line = ArrowLine(t, s, color='b', ls='', lw=2, arrow='>', arrowsize=20) sage: ax.add_line(line) sage: ax.set_xlim(3,3) (3, 3) sage: ax.set_ylim(3,3) (3, 3) sage: pylab.show() """ arrows = {'>' : '_draw_triangle_arrow'} def __init__(self, *args, **kwargs): """Initialize the line and arrow.""" self._arrow = kwargs.pop('arrow', None) self._arrowsize = kwargs.pop('arrowsize', 2*4) self._arrowedgecolor = kwargs.pop('arrowedgecolor', 'b') self._arrowfacecolor = kwargs.pop('arrowfacecolor', 'b') self._arrowedgewidth = kwargs.pop('arrowedgewidth', 4) self._arrowheadwidth = kwargs.pop('arrowheadwidth', self._arrowsize) self._arrowheadlength = kwargs.pop('arrowheadlength', self._arrowsize) Line2D.__init__(self, *args, **kwargs) def draw(self, renderer): """Draw the line and arrowhead using the passed renderer.""" if self._invalid: self.recache() renderer.open_group('arrowline2d') if not self._visible: return Line2D.draw(self, renderer) if self._arrow is not None: gc = renderer.new_gc() self._set_gc_clip(gc) gc.set_foreground(self._arrowedgecolor) gc.set_linewidth(self._arrowedgewidth) gc.set_alpha(self._alpha) funcname = self.arrows.get(self._arrow, '_draw_nothing') if funcname != '_draw_nothing': tpath, affine = self._transformed_path.get_transformed_points_and_affine() arrowFunc = getattr(self, funcname) arrowFunc(renderer, gc, tpath, affine.frozen()) renderer.close_group('arrowline2d') _arrow_path = Path([[0.0, 0.0], [1.0, 1.0], [1.0, 1.0], [0.0, 0.0]], codes=[Path.MOVETO, Path.LINETO,Path.LINETO, Path.CLOSEPOLY]) def _draw_triangle_arrow(self, renderer, gc, path, path_trans): """Draw a triangular arrow.""" segment = [i[0] for i in path.iter_segments()][2:] startx,starty = path_trans.transform_point(segment[0]) endx,endy = path_trans.transform_point(segment[1]) angle = math.atan2(endystarty, endxstartx) halfwidth = 0.5*renderer.points_to_pixels(self._arrowheadwidth) length = renderer.points_to_pixels(self._arrowheadlength) transform = matplotlib.transforms.Affine2D().scale(length,halfwidth).rotate(angle).translate(endx,endy) rgbFace = self._get_rgb_arrowface() renderer.draw_path(gc, self._arrow_path, transform, rgbFace) def _get_rgb_arrowface(self): facecolor = self._arrowfacecolor if matplotlib.cbook.is_string_like(facecolor) and facecolor.lower()=='none': rgbFace = None else: rgbFace = matplotlib.colors.colorConverter.to_rgb(facecolor) return rgbFace 
From: Michael Roettger <roettm@fm...>  20080822 07:36:42

Hi all, maybe I've misunderstood something concerning masking or quiver plots: I want to exclude some data from a quiver plot. Here's an example: 8< import numpy as N import pylab as pl import matplotlib.numerix.ma as ma # prepare data X,Y = pl.meshgrid(range(5),range(5)) angles = pl.rand(5,5) U = N.cos(angles) V = N.sin(angles) # prepare mask M = N.zeros((5,5), dtype='bool') M[2,2] = True # apply mask Um = ma.masked_array(U,mask=M) Vm = ma.masked_array(V,mask=M) # plot pl.quiver(X,Y,Um,Vm) # pl.plot(range(5),Um[2],'x') pl.show() >8 Using the commented 'plot' command works as expected, but 'quiver' results in empty axes. If I take U,V instead of Um,Vm, the arrows are drawn .. What am I doing wrong or is there another way to exclude arrows from being plotted? Thank you in advance, Michael 
From: Jack Sankey <jack.sankey@gm...>  20080822 00:43:10

well it hasn't caused me any crashes yet so far as I can tell. Other naughty things I do cause crashes, though. On Thu, Aug 21, 2008 at 8:03 PM, Ryan May <rmay31@...> wrote: > On Thu, Aug 21, 2008 at 4:58 PM, Darren Dale <dsdale24@...> wrote: > >> On Thursday 21 August 2008 17:36:50 Eric Firing wrote:> Jack Sankey wrote: >> > > pylab.gcf().clear(); pylab.show() # nothing happens >> > >> > With interactive mode off, in a script, show() should never be called >> > more than once; it should be the last plotrelated line of the script. >> >> I thought we supported repeated calls to show. Some people use multiple >> show >> calls in order to step through a number of plots in a script. > > > My impression has always been that calling show() more than once is *bad* > and not supported. > > Ryan > >  > Ryan May > Graduate Research Assistant > School of Meteorology > University of Oklahoma > 
From: Ryan May <rmay31@gm...>  20080822 00:03:17

On Thu, Aug 21, 2008 at 4:58 PM, Darren Dale <dsdale24@...> wrote: > On Thursday 21 August 2008 17:36:50 Eric Firing wrote:> Jack Sankey wrote: > > > pylab.gcf().clear(); pylab.show() # nothing happens > > > > With interactive mode off, in a script, show() should never be called > > more than once; it should be the last plotrelated line of the script. > > I thought we supported repeated calls to show. Some people use multiple > show > calls in order to step through a number of plots in a script. My impression has always been that calling show() more than once is *bad* and not supported. Ryan  Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma 