From: Lionel Roubeyrie <lroubeyrie@li...>  20060404 09:48:41

Hi all, I'm new in the matplotlib word, and I try to plot a windrose, but I don't find any function doing that. Then, trying to solve that by the polar plot, I don't find how to say matplotlib to plot bar char on polar axes. Can someone gives me a way? thanks  Lionel Roubeyrie  lroubeyrie@... LIMAIR http://www.limair.asso.fr 
From: Eric Firing <efiring@ha...>  20060404 22:38:29

Lionel Roubeyrie wrote: > Hi all, > I'm new in the matplotlib word, and I try to plot a windrose, but I don't find > any function doing that. Then, trying to solve that by the polar plot, I > don't find how to say matplotlib to plot bar char on polar axes. Can someone > gives me a way? > thanks > Lionel, Polar axis support is embryonic; I don't see an easy way to make a polar bar chart. You could make the bar outlines using "plot" on a polar axis. Eric 
From: John Hunter <jdhunter@ac...>  20060405 05:23:28

>>>>> "Eric" == Eric Firing <efiring@...> writes: Eric> Polar axis support is embryonic; I don't see an easy way to Eric> make a polar bar chart. You could make the bar outlines Eric> using "plot" on a polar axis. Although polar support is patchy, it usually can be made to work. Eg, it already handles most types of objects (text, lines, collections). I took a look and noticed that it did not draw it's patches, though it stores them and handles the transformations properly. This is simply one line sin of omission (which I've fixed in svn), ie I needed to add the patches to the list of artists being drawn in PolarAxes.draw. Here is a little script that shows how to add "rectangles" to polar plots (requires svn 2258) from matplotlib.patches import Rectangle from matplotlib.axes import PolarSubplot import matplotlib.cm as cm from pylab import figure, show, nx dtheta = nx.pi/8 r = 1 theta = 0 fig = figure() ax = PolarSubplot(fig, 111) fig.add_axes(ax) N = 15 for i in range(N): frac = float(i)/N rect = Rectangle( (theta, 0), dtheta, r, facecolor=cm.jet(frac)) ax.add_patch(rect) theta += dtheta r*=1.05 ax.autoscale_view() show() Although I don't have experience with windrose plots, this can probably serve as the foundation. The autoscale view functionality is clearly off, but it mostly works. One can do the same with arbitrary patches (eg Polygons), as long as you construct vertices where the x/width attribute is interpreted as radians, and the y/height attribute is interpreted as radius. JDH 
From: Lionel Roubeyrie <lroubeyrie@li...>  20060406 09:01:46

Hi, sorry to ask for that, but I'm not very familiar with matplotlib svn=20 repository, and after going to sourceforge, I have done a "svn co ..." whic= h=20 copy all matplotlib branch in a local directory. Now, what do I do? What=20 files do I have to compile? Thanks PS : I have done a very little script with scipy to compute wind frequencie= s,=20 but if someone know a dedicated module which do that, I could verify my wor= k. Le Mercredi 05 Avril 2006 07:20, John Hunter a =E9crit=A0: > >>>>> "Eric" =3D=3D Eric Firing <efiring@...> writes: > > Eric> Polar axis support is embryonic; I don't see an easy way to > Eric> make a polar bar chart. You could make the bar outlines > Eric> using "plot" on a polar axis. > > Although polar support is patchy, it usually can be made to work. Eg, > it already handles most types of objects (text, lines, collections). > I took a look and noticed that it did not draw it's patches, though it > stores them and handles the transformations properly. This is simply > one line sin of omission (which I've fixed in svn), ie I needed to add > the patches to the list of artists being drawn in PolarAxes.draw. > > Here is a little script that shows how to add "rectangles" to polar > plots (requires svn 2258) > > from matplotlib.patches import Rectangle > from matplotlib.axes import PolarSubplot > import matplotlib.cm as cm > from pylab import figure, show, nx > > dtheta =3D nx.pi/8 > r =3D 1 > theta =3D 0 > > fig =3D figure() > ax =3D PolarSubplot(fig, 111) > fig.add_axes(ax) > N =3D 15 > for i in range(N): > frac =3D float(i)/N > rect =3D Rectangle( (theta, 0), dtheta, r, facecolor=3Dcm.jet(frac)) > ax.add_patch(rect) > theta +=3D dtheta > r*=3D1.05 > ax.autoscale_view() > show() > > Although I don't have experience with windrose plots, this can > probably serve as the foundation. The autoscale view functionality is > clearly off, but it mostly works. One can do the same with arbitrary > patches (eg Polygons), as long as you construct vertices where the > x/width attribute is interpreted as radians, and the y/height > attribute is interpreted as radius. > > JDH > > >  > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live > webcast and join the prime developer group breaking into this new coding > territory! > http://sel.asus.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers =2D=20 Lionel Roubeyrie  lroubeyrie@... LIMAIR http://www.limair.asso.fr 
From: Eric Firing <efiring@ha...>  20060405 07:11:50

John, ThanksI thought it should work, but when I tried it and it didn't, I failed to look more closely. Now a question: is there a reason why the argument order for polar plotting is (theta, r)? In thinking about polar coordinates, I always think of them in the reverse order (r, theta), and I think this is the way I have always seen polar coordinates in math and physics books. Eric John Hunter wrote: >>>>>>"Eric" == Eric Firing <efiring@...> writes: > > > Eric> Polar axis support is embryonic; I don't see an easy way to > Eric> make a polar bar chart. You could make the bar outlines > Eric> using "plot" on a polar axis. > > Although polar support is patchy, it usually can be made to work. Eg, > it already handles most types of objects (text, lines, collections). > I took a look and noticed that it did not draw it's patches, though it > stores them and handles the transformations properly. This is simply > one line sin of omission (which I've fixed in svn), ie I needed to add > the patches to the list of artists being drawn in PolarAxes.draw. > > Here is a little script that shows how to add "rectangles" to polar > plots (requires svn 2258) > > from matplotlib.patches import Rectangle > from matplotlib.axes import PolarSubplot > import matplotlib.cm as cm > from pylab import figure, show, nx > > dtheta = nx.pi/8 > r = 1 > theta = 0 > > fig = figure() > ax = PolarSubplot(fig, 111) > fig.add_axes(ax) > N = 15 > for i in range(N): > frac = float(i)/N > rect = Rectangle( (theta, 0), dtheta, r, facecolor=cm.jet(frac)) > ax.add_patch(rect) > theta += dtheta > r*=1.05 > ax.autoscale_view() > show() > > Although I don't have experience with windrose plots, this can > probably serve as the foundation. The autoscale view functionality is > clearly off, but it mostly works. One can do the same with arbitrary > patches (eg Polygons), as long as you construct vertices where the > x/width attribute is interpreted as radians, and the y/height > attribute is interpreted as radius. > > JDH 
From: John Hunter <jdhunter@ac...>  20060406 01:33:26

>>>>> "Eric" == Eric Firing <efiring@...> writes: Eric> Now a question: is there a reason why the argument order for Eric> polar plotting is (theta, r)? In thinking about polar Eric> coordinates, I always think of them in the reverse order (r, Eric> theta), and I think this is the way I have always seen polar Eric> coordinates in math and physics books. I can't remember a reason if there was one, and now that I think about it your way probably makes more sense. But is it worth breaking compatibility? JDH 
From: Darren Dale <dd55@co...>  20060406 01:49:20

On Wednesday 05 April 2006 9:30 pm, John Hunter wrote: > >>>>> "Eric" == Eric Firing <efiring@...> writes: > > Eric> Now a question: is there a reason why the argument order for > Eric> polar plotting is (theta, r)? In thinking about polar > Eric> coordinates, I always think of them in the reverse order (r, > Eric> theta), and I think this is the way I have always seen polar > Eric> coordinates in math and physics books. > > I can't remember a reason if there was one, and now that I think about > it your way probably makes more sense. But is it worth breaking > compatibility? I think (theta, r) makes more sense for polar plotting. Are we plotting r(theta) or theta(r)? 
From: Eric Firing <efiring@ha...>  20060406 02:10:05

Darren Dale wrote: > On Wednesday 05 April 2006 9:30 pm, John Hunter wrote: > >>>>>>>"Eric" == Eric Firing <efiring@...> writes: >> >> Eric> Now a question: is there a reason why the argument order for >> Eric> polar plotting is (theta, r)? In thinking about polar >> Eric> coordinates, I always think of them in the reverse order (r, >> Eric> theta), and I think this is the way I have always seen polar >> Eric> coordinates in math and physics books. >> >>I can't remember a reason if there was one, and now that I think about >>it your way probably makes more sense. But is it worth breaking >>compatibility? > > > I think (theta, r) makes more sense for polar plotting. Are we plotting > r(theta) or theta(r)? Darren, John, That dawned on me this morning; for line and point plotting, theta is normally the independent variable, so the present order does make sense. Eric 
From: Christopher Barker <Chris.B<arker@no...>  20060405 16:21:36

Lionel Roubeyrie wrote: > I'm new in the matplotlib word, and I try to plot a windrose, When you do get it figured out, be sure to post here. I know I could use it, and I'm sure there are others. Chris  Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 5266959 voice 7600 Sand Point Way NE (206) 5266329 fax Seattle, WA 98115 (206) 5266317 main reception Chris.Barker@... 
From: Lionel Roubeyrie <lroubeyrie@li...>  20060410 10:15:20

Hi all, thanks for your help and for polar axes, I've got a good result like you can see here : http://www.limair.asso.fr/share/windrose.png If someone is interested by the code, I can send it to him (need scipy for computing frequencies). bye  Lionel Roubeyrie  lroubeyrie@... LIMAIR http://www.limair.asso.fr 
From: John Hunter <jdhunter@ac...>  20060410 14:54:03

>>>>> "Lionel" == Lionel Roubeyrie <lroubeyrie@...> writes: Lionel> Hi all, thanks for your help and for polar axes, I've got Lionel> a good result like you can see here : Lionel> http://www.limair.asso.fr/share/windrose.png If someone is Lionel> interested by the code, I can send it to him (need scipy Lionel> for computing frequencies). bye Lionel>  Lionel Roubeyrie  lroubeyrie@... LIMAIR Lionel> http://www.limair.asso.fr Please post it here. With your permission, we may adapt it to make a general purpose windrose or polar areas plotting function for matplotlib. We can probably work around the scipy dependency. Thanks! JDH 
From: Lionel Roubeyrie <lroubeyrie@li...>  20060410 15:24:16
Attachments:
windrose.py

Hi, ok for the code, here it is, and by advance, sorry for my poor english :/ Le Lundi 10 Avril 2006 16:50, John Hunter a =E9crit=A0: > Please post it here. With your permission, we may adapt it to make a > general purpose windrose or polar areas plotting function for > matplotlib. > > We can probably work around the scipy dependency. > > Thanks! > JDH =2D=20 Lionel Roubeyrie  lroubeyrie@... LIMAIR http://www.limair.asso.fr 
From: John Hunter <jdhunter@ac...>  20060410 15:45:22

>>>>> "Lionel" == Lionel Roubeyrie <lroubeyrie@...> writes: Lionel> Hi, ok for the code, here it is, and by advance, sorry for Lionel> my poor english :/ Hi Lionel, thanks for this code. I took a quick peek. matplotlib does not accept code under the GPL license. The license we use is based on the python software foundation license and is more permissive than the GPL, in that it allows people to redistribute matplotlib in closedsource proprietary apps. So if you would like for us to include your windrose code (or a derivative of it) we will need it preferably under the matplotlib license, or a BSD/MIT like license. Here is a post I wrote earlier in another project I was involved in about why I prefer the use of more permissive BSDlike licenses like the python license https://cirl.berkeley.edu/view/Grants/LicensingPitch Thanks! JDH 
From: Lionel Roubeyrie <lroubeyrie@li...>  20060411 06:59:22
Attachments:
windrose.py

The same code, with the right license :) Hope it can help someone. Le Lundi 10 Avril 2006 17:42, John Hunter a =E9crit=A0: > >>>>> "Lionel" =3D=3D Lionel Roubeyrie <lroubeyrie@...> writes: > > Lionel> Hi, ok for the code, here it is, and by advance, sorry for > Lionel> my poor english :/ > > Hi Lionel, thanks for this code. I took a quick peek. matplotlib > does not accept code under the GPL license. The license we use is > based on the python software foundation license and is more permissive > than the GPL, in that it allows people to redistribute matplotlib in > closedsource proprietary apps. So if you would like for us to > include your windrose code (or a derivative of it) we will need it > preferably under the matplotlib license, or a BSD/MIT like license. > > Here is a post I wrote earlier in another project I was involved in > about why I prefer the use of more permissive BSDlike licenses like > the python license > > https://cirl.berkeley.edu/view/Grants/LicensingPitch > > Thanks! > JDH > > >  > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live > webcast and join the prime developer group breaking into this new coding > territory! > http://sel.asus.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers =2D=20 Lionel Roubeyrie  lroubeyrie@... LIMAIR http://www.limair.asso.fr 