New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when creating polar plot with log scale on radial axis #1847
Comments
Any progress on this? This is pretty frustrating, as the polar log plots seem to be useless. |
Your example does not crash for me, running 1.4.x. What versions have you tried? |
I was able to get the code running, but the problem I was running into was discussed in one of the followups of that stack overflow discussion. The log polar plots were plotting 'negative' radii. However, I updated to the latest matplotlib, and it doesn't appear to be doing this anymore, although how set_rlim/set_rmax/set_rmin exactly affects the scaling of the plot seems kind of convoluted. However, with enough toying I can get the results I want. |
In fact, it seems that set_rlim(0,1) will result in limits (u, 1), where u > 0 (.01 in my case), but set_rmin(0), set_rmax(1) will give the intended behavior. |
With a log scale on the radial axis, a lower limit of zero makes no sense at all; what is the intended behavior to which you refer? |
From what I've seen, setting the lower limit to 0 and the maximum limit to some value > 0 will give a plot that goes from the lowest data value given to the maximum limit supplied. But when setting rmin to something less than the lowest data value given, the bounds are no longer obeyed. So in that sense, I guess by a lower limit of 0 I just meant fitting the bound to the lower range of the data. Which has seemed hard to achieve otherwise. Unless I'm missing something |
The issue is resolved for me. |
matplotlib will crash when a log scale is used for the radial axis of a polar plot, unless very specific commands are used to create the plot. The following code will cause a crash:
However, if
ax.set_rlim((0.1, 100.0))
is changed toax.set_rlim((0., 100.0))
the plot is created and there is no error or warning. The plot will also crash if theset_rlim
method is not called beforeset_rscale
. Using set_ylim or set_yscale results in the same behavior.Note that this issue is not specific to a particular backend, as it occurs when saving the figure as a PDF or displaying it in a window with gtkagg.
Other users have this problem; see http://stackoverflow.com/questions/14919407/how-to-use-log-scale-on-polar-axis-in-matplotlib
The text was updated successfully, but these errors were encountered: