Ryan May wrote: > On Tue, Dec 2, 2008 at 11:27 AM, Nils Wagner > <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> > wrote: > > Thank you very much ! > It would be nice to have that information in the docstring > > > Done. Thanks for updating the docstring. I actually saw this as a usability bug and have come up with a patch such that polar() (et al) will *replace* the current axes with a polar plot if it isn't already polar. This is (from the user's perspective) similar to how, for example, a histogram plot would work -- that is, you don't have to tell subplot you're about to plot a histogram.
But Ryan's new docstring is not obsolete with respect to my proposed change. Both techniques will work, and in fact subplot(polar=True); polar(...) will be slightly faster since it avoids creating a linear axes which is subsequently thrown away. Any argument against committing my change? > > > The next inquiry is related to xticks. > I have added > > xticks(linspace(0,2*pi,24,endpoint=False)) > > The difference between consecutive xticks is varying between 14 > and 16 degrees. > > For what reason ? > > > Looks like roundoff error. For instance: > > linspace(0, 2*pi, 24)[7] * 180. / pi > 104.999999999999 > > If you format that with '%d', it becomes 104, not 105. > > Is there an accepted way of doing this rounding in matplotlib that > doesn't round in odd cases? The polar theta tick formatter could be changed to call "round", I guess. Alternatively, it looks like '%0.0f' also does the right thing. I think that's generally what people would want for polar plots. This change would only affect polar theta ticks, so we don't need to worry about a change in behavior in standard Euclidean plots. Ryan's workaround (to get around this numerically external to matplotlib) is a good suggestion as well, but I think changing the formatter may be less surprising... Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------- 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://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users