Laurent Mychkine wrote:
hi,I'm using polar bars to plot windroses. Since the 0.98.5 version i have some issues with the plots. The 0° bar is not displayed in the good way. This bar is located between -0.26 radian and 0.26 radian but it is printed counterclockwise. It was working perfectly with matplotlib version 0.98.3. I just switched to version 0.98.5 because of the NaN bug of the previous version.
The bug was fixed on Jan. 2. Can you install mpl from svn? Or just patch your installation with the attached diff? (Only the first hunk is critical for the bug.)
Eric
Any idea how i could make it work again ? Ty!! from pylab import * nb_secteur=12 fig = figure(2,figsize=(8,8)) ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True,) thetagrids([90,45,0,315,270,225,180,135], labels=["N","NE","E","SE","S","SO","O","NO"]) theta = arange(0.0-pi/nb_secteur, 2*pi-pi/nb_secteur, 2*pi/nb_secteur) radii = [10.,20,10,5,3,4,3,4,6,4,2,9] width = 2*pi/nb_secteur bars = ax.bar(theta, radii, width=width, bottom=0.0 ) for r,bar in zip(radii, bars): bar.set_facecolor( 'blue') bar.set_alpha(0.3) text(1,0.69,"%",transform = ax.transAxes) show() ------------------------------------------------------------------------ ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ------------------------------------------------------------------------ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Index: lib/matplotlib/projections/polar.py =================================================================== --- lib/matplotlib/projections/polar.py (revision 6730) +++ lib/matplotlib/projections/polar.py (revision 6731) @@ -57,8 +57,6 @@ def transform_path(self, path): vertices = path.vertices - t = vertices[:, 0:1] - t[t != (npy.pi * 2.0)] %= (npy.pi * 2.0) if len(vertices) == 2 and vertices[0, 0] == vertices[1, 0]: return Path(self.transform(vertices), path.codes) ipath = path.interpolated(self._resolution) @@ -174,6 +172,11 @@ def refresh(self): return self.base.refresh() + def view_limits(self, vmin, vmax): + vmin, vmax = self.base.view_limits(vmin, vmax) + return 0, vmax + + RESOLUTION = 75 def __init__(self, *args, **kwargs): @@ -280,6 +283,7 @@ return Circle((0.5, 0.5), 0.5) def set_rmax(self, rmax): + self.viewLim.y0 = 0 self.viewLim.y1 = rmax angle = self._r_label1_position.to_values()[4] self._r_label1_position.clear().translate(
------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
_______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users