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 to ax.set_rlim((0., 100.0)) the plot is created and there is no error or warning. The plot will also crash if the set_rlim method is not called before set_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.
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.
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
Reading through this again, it looks like the original problem has been (mysteriously?) fixed. From reading this + the SO thread I am having trouble sorting out exactly what is wrong so I am closing this issue.
@amill676@cfinch If you are still having problems please open a new issue.
Activity
amill676 commented on Dec 15, 2013
Any progress on this? This is pretty frustrating, as the polar log plots seem to be useless.
efiring commented on Dec 15, 2013
Your example does not crash for me, running 1.4.x. What versions have you tried?
amill676 commented on Dec 15, 2013
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.
amill676 commented on Dec 15, 2013
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.
efiring commented on Dec 15, 2013
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?
amill676 commented on Dec 15, 2013
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
tacaswell commented on Jun 29, 2014
Reading through this again, it looks like the original problem has been (mysteriously?) fixed. From reading this + the SO thread I am having trouble sorting out exactly what is wrong so I am closing this issue.
@amill676 @cfinch If you are still having problems please open a new issue.
cfinch commented on Jul 24, 2014
The issue is resolved for me.