windrose 0.4

Hi all,
after some suggestions, here is the latest version of windrose. Now, keywords
args are passed by **kwargs, "bar" style have a "opening" arg for controlling
the sectors angles, legends are positionned with "legendloc" and their size
with "legendsize", and box are not displayed anymore.
Hope you find it usefull, any comments welcome.

Cordialement

windrose.py (7.76 KB)

ex4.png

···

--
Lionel Roubeyrie - lroubeyrie@...1068...
LIMAIR
http://www.limair.asso.fr

Lionel

Improving with each version! A few small tweaks:

* do not outline the colors in black; its hard to see smaller/shorter
lines
* the % labels need either to go along a vector NOT used to draw data,
or
be drawn last (on top of data); or a combination of both
* the 0.0% label can probably be omitted from the centre
* drawing a title("") on the plot is still problematic (it overwrites
the "N" in
some cases)
* default background color should be white
* a legend title will *very* useful

And a question - is it possible to restrict the plot to a portion of
the area;
say to the left, with a "rectangle" of the space available to the
right; or
up to the top, with a "rectangle" of the space available to the
bottom.
Plots often have to annotated and its useful to have some working
space
to do this.

Thanks for all the good work!
Derek

PS Does anyone else using this program get the strange "[" and "]"
signs
around the data ranges in the legend - how can this be turned off?

Lionel Roubeyrie <lroubeyrie@...1068...> 2006/10/13 04:06:43 PM

Hi all,
after some suggestions, here is the latest version of windrose. Now,
keywords
args are passed by **kwargs, "bar" style have a "opening" arg for
controlling
the sectors angles, legends are positionned with "legendloc" and their
size
with "legendsize", and box are not displayed anymore.
Hope you find it usefull, any comments welcome.

Cordialement

···

--
Lionel Roubeyrie - lroubeyrie@...1068...
LIMAIR
http://www.limair.asso.fr

--
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.

CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html

CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html

For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@...1230...

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.

Hi Derek,
happy to see you use it, here is windrose0.5 with some improvments :slight_smile:

* do not outline the colors in black; its hard to see smaller/shorter
lines

Done

* the % labels need either to go along a vector NOT used to draw data,
or
be drawn last (on top of data); or a combination of both

Now "%" is set with the external label. I don't find how to set labels (and
grids) above patches, ax.set_axisbelow(False) doesn't work :frowning: But for the
moment you can use labangle parameter to move the labels.

* the 0.0% label can probably be omitted from the centre
* drawing a title("") on the plot is still problematic (it overwrites
the "N" in some cases)

0.0 is not longer draw

* default background color should be white

Hum, everybody can set it directly from matplotlibrc or creating an polar axis
before.

* a legend title will *very* useful

Waiting for polar axes legend improvments :slight_smile:

And a question - is it possible to restrict the plot to a portion of
the area;
say to the left, with a "rectangle" of the space available to the
right; or
up to the top, with a "rectangle" of the space available to the
bottom.
Plots often have to annotated and its useful to have some working
space
to do this.

Don't know if I really understand what you want, but why don't you use subplot
to split your figures?

Thanks for all the good work!
Derek

PS Does anyone else using this program get the strange "[" and "]"
signs around the data ranges in the legend - how can this be turned off?

You're the first saying you use it :slight_smile:
Maybe differents progs versions. I use:

datas>[42]>matplotlib.__version__

   Out [42]:'0.87.5'

datas>[43]>scipy.__version__

   Out [43]:'0.5.1'

datas>[44]>numpy.__version__

   Out [44]:'1.0b5'

Lionel

windrose.py (8.01 KB)

···

--
Lionel Roubeyrie - lroubeyrie@...1068...
LIMAIR
http://www.limair.asso.fr

I'd like to see what the latest version does -- can you post a segment
of code that demonstrates?

Cheers
Stéfan

···

On Wed, Oct 18, 2006 at 05:57:55PM +0200, Lionel Roubeyrie wrote:

Hi Derek,
happy to see you use it, here is windrose0.5 with some improvments :slight_smile:

Stéfan,
here it is :

import windrose
ax=subplot(221,polar=True)
freq,ax=windrose.windplot(vents['VV'],vents['DV'],speed_classes=[1,2,3,4,5],counts=False,sectors=18,style='bar',axes=ax)
ax=subplot(222,polar=True)
freq,ax=windrose.windplot(vents['VV'],vents['DV'],speed_classes=[1,2,3,4,5],counts=False,sectors=18,style='bar',axes=ax,nolegend=True,opening=0.5,labangle=-90)
ax=subplot(223,polar=True)
freq,ax=windrose.windplot(vents['VV'],vents['DV'],speed_classes=[1,2,3,4,5],counts=True,sectors=18,style='bar2',axes=ax,nolegend=True,labangle=-90)
ax=subplot(224,polar=True)
freq,ax=windrose.windplot(vents['VV'],vents['DV'],speed_classes=[1,2,3,4,5],counts=True,sectors=18,style='line',axes=ax,nolegend=True,labangle=-30)
setp(ax.rgridlabels, fontsize=6)

Lionel

wr.png

···

Le mercredi 18 octobre 2006 18:11, Stefan van der Walt a écrit :

On Wed, Oct 18, 2006 at 05:57:55PM +0200, Lionel Roubeyrie wrote:
> Hi Derek,
> happy to see you use it, here is windrose0.5 with some improvments :slight_smile:

I'd like to see what the latest version does -- can you post a segment
of code that demonstrates?

Cheers
Stéfan

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Lionel Roubeyrie - lroubeyrie@...1068...
LIMAIR
http://www.limair.asso.fr

Stefan

Here is short test program:

from pylab import *
import windrose
figure(figsize=(8,8))
vVeloc = [ 0.2, 0.08, 0.2, 0.35, 0.09, 0.45, 0.5, 0.2, 0.33, 0.44, 0.22, 0.07 ]
vDir = [ 65., 58., 59., 74., 231., 168., 183., 166., 214., 255., 60., 62.]
freq,ax=windrose.windplot(vVeloc,vDir,counts=False,speed_classes=[0.0, 0.1,0.2,0.3,0.4],sectors=8,labangle=66,style='bar2')
fig=ax.get_figure()
for leg in fig.legends:
setp(leg.get_texts(), fontsize=8)
draw()
show()

The plot does "look better" as you add more data....

Derek

Stefan van der Walt <stefan@...841...> 2006/10/18 06:11:23 PM >>>

Hi Derek,
happy to see you use it, here is windrose0.5 with some improvments :slight_smile:

I'd like to see what the latest version does -- can you post a segment
of code that demonstrates?

Cheers
Stéfan

···

On Wed, Oct 18, 2006 at 05:57:55PM +0200, Lionel Roubeyrie wrote:

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.

CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html

CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html

For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@...1230...

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.

Lionel

Is it possible to change the font sizes on the
(a) direction labels (N, S, E, W)
(b) % values labelling the rings?

Thanks
Derek

···

--
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.

CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html

CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html

For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@...1230...

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.

Hi Derek,
yes you can, because you've got an axes instance:

freq, axe= windrose.windplot( ...
setp(axe.thetagridlabels,fontsize=16) #for directions
setp(axe.rgridlabels,fontsize=10) #for values

I want to change how windrose is called and controled, like all others
matplotlib graphs. Maybe in 0.6.

···

Le jeudi 26 octobre 2006 08:34, Derek Hohls a écrit :

Lionel

Is it possible to change the font sizes on the
(a) direction labels (N, S, E, W)
(b) % values labelling the rings?

Thanks
Derek

--
Lionel Roubeyrie - lroubeyrie@...1068...
LIMAIR
http://www.limair.asso.fr

Lionel

I have encountered a problem with windrose. In some cases, one or more
of the
wind direction values are null [''] - the program then fails on line
200:
   values = select( [greater_equal( direction, wind_classes[i]
)],[speed], default=-1.e20 )
Is it possible for you to upgrade the program to perform error
trapping
and simply skip (i.e. not process) any values that are null (and handle
the
exceptional case that all of them might, in fact, be null).

Thanks!
Derek

Lionel Roubeyrie <lroubeyrie@...1068...> 2006/10/18 05:57:55 PM

Hi Derek,
happy to see you use it, here is windrose0.5 with some improvments :slight_smile:

* do not outline the colors in black; its hard to see

smaller/shorter

lines

Done

* the % labels need either to go along a vector NOT used to draw

data,

or
be drawn last (on top of data); or a combination of both

Now "%" is set with the external label. I don't find how to set labels
(and
grids) above patches, ax.set_axisbelow(False) doesn't work :frowning: But for
the
moment you can use labangle parameter to move the labels.

* the 0.0% label can probably be omitted from the centre
* drawing a title("") on the plot is still problematic (it

overwrites

the "N" in some cases)

0.0 is not longer draw

* default background color should be white

Hum, everybody can set it directly from matplotlibrc or creating an
polar axis
before.

* a legend title will *very* useful

Waiting for polar axes legend improvments :slight_smile:

And a question - is it possible to restrict the plot to a portion of
the area;
say to the left, with a "rectangle" of the space available to the
right; or
up to the top, with a "rectangle" of the space available to the
bottom.
Plots often have to annotated and its useful to have some working
space
to do this.

Don't know if I really understand what you want, but why don't you use
subplot
to split your figures?

Thanks for all the good work!
Derek

PS Does anyone else using this program get the strange "[" and "]"
signs around the data ranges in the legend - how can this be turned

off?
You're the first saying you use it :slight_smile:
Maybe differents progs versions. I use:

datas>[42]>matplotlib.__version__

   Out [42]:'0.87.5'

datas>[43]>scipy.__version__

   Out [43]:'0.5.1'

datas>[44]>numpy.__version__

   Out [44]:'1.0b5'

Lionel

···

--
Lionel Roubeyrie - lroubeyrie@...1068...
LIMAIR
http://www.limair.asso.fr

--
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.

CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html

CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html

For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@...1230...

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.

Hi Derek,
I forgot to mention: you can pass throught your problem by using a masked
array instead of a simple array, and it should work fine, the 'default'
parameter is here to fill missing value by -1.e20, then these directions will
be dropped if your speed_classes not include that missing value (generally we
compute on positives speeds).

···

Le Jeudi 01 Février 2007 13:17, Derek Hohls a écrit :

Lionel

I have encountered a problem with windrose. In some cases, one or more
of the
wind direction values are null [''] - the program then fails on line
200:
   values = select( [greater_equal( direction, wind_classes[i]
)],[speed], default=-1.e20 )
Is it possible for you to upgrade the program to perform error
trapping
and simply skip (i.e. not process) any values that are null (and handle
the
exceptional case that all of them might, in fact, be null).

Thanks!
Derek

--
Lionel Roubeyrie - lroubeyrie@...1068...
LIMAIR
http://www.limair.asso.fr