Plot functions correctly(ish) but when set to a log-plot the plot malfunctions: the error ""posx and posy should be finite values"" and the entire plot is a blank circle. The 'r' labels are still not correct normally.
/home/chahak/Documents/matplotlib/issue_24383.py:14: UserWarning: Attempt to set non-positive ylim on a log-scaled axis will be ignored.
plt.show()
posx and posy should be finite values
posx and posy should be finite values
Reacted by Thomas A Caswell, Tim Hoffmann, Gerald and Constantin Koch
The 0 cap was added to preserve old behaviour from when it didn't support negative radii. However, I don't think log scales were supported then either.
posxandposyshouldbefinitevaluesposxandposyshouldbefinitevaluesposxandposyshouldbefinitevaluesposxandposyshouldbefinitevalues/Users/dstansby/github/matplotlib/lib/matplotlib/scale.py:253: RuntimeWarning: overflowencounteredinpowerreturnnp.power(self.base, a)
@Gerald-Meyers could you possibly trim that data down to the minimal needed to reproduce (or is this not data dependent)?
I can assure you I tested this on 6 different data sets. The data is not the problem. It it matters, you are more than welcome to slice the data when you np.genfromtxt. The polar plot did function as expected without radial log-scale. However, the circular grid lines for the r values ranged from 0 to 1, not from 0 to 1e7.
For example, here is normal plot of one of my data sets without any log-scale over the domain [20,80]=Δ60 degrees.
Here is the same data set, but with the extra line of code
fig, ax = subplots( 1, 1,
figsize=(8, 8),
subplot_kw={'projection':'polar'} # <- extra line
)
It is worth noting that there are no non-positive(=negative,zero) values in this data set. And the same polar plot when I enable the radial log-scale with
plt.yscale('log')
Here is another data set over a 1 degree domain.
And the same data with polar as before.
And with log scale.
Clearly there are a few more issues than just 'log-scale' broken.
Activity
tacaswell commented on Nov 6, 2022
@Gerald-Meyers could you possibly trim that data down to the minimal needed to reproduce (or is this not data dependent)?
chahak13 commented on Nov 9, 2022
This bug doesn't seem data dependent. Here's a small reproduction
Which gives this error
ksunden commented on Nov 10, 2022
Appears to be related to RadialLocator.view_limits
matplotlib/lib/matplotlib/projections/polar.py
Lines 434 to 439 in 9d8fde2
In particular I'm suspicious that the vmin capping at 0 may not be desirable with log scale, but haven't fully worked out the details.
QuLogic commented on Nov 11, 2022
The 0 cap was added to preserve old behaviour from when it didn't support negative radii. However, I don't think log scales were supported then either.
dstansby commented on Nov 12, 2022
I've idependently stumbled upon this investigating something else. An even smaller example:
dstansby commented on Nov 12, 2022
At least one issue is the polar limits are not being set to finite values (ie. on a log scale, vmin > 0):
(0.8912509381337456, 11.220184543019636) {}
(0.0, 1.0) {'subplot_kw': {'projection': 'polar'}}
Gerald-Meyers commented on Nov 12, 2022
I can assure you I tested this on 6 different data sets. The data is not the problem. It it matters, you are more than welcome to slice the data when you np.genfromtxt. The polar plot did function as expected without radial log-scale. However, the circular grid lines for the r values ranged from 0 to 1, not from 0 to 1e7.
For example, here is normal plot of one of my data sets without any log-scale over the domain [20,80]=Δ60 degrees.

Here is the same data set, but with the extra line of code
fig, ax = subplots( 1, 1, figsize=(8, 8), subplot_kw={'projection':'polar'} # <- extra line )It is worth noting that there are no non-positive(=negative,zero) values in this data set. And the same polar plot when I enable the radial log-scale with

plt.yscale('log')
Here is another data set over a 1 degree domain.

And the same data with polar as before.

And with log scale.

Clearly there are a few more issues than just 'log-scale' broken.
Gerald-Meyers commented on Nov 12, 2022
09192022_NaCl_0-2mmS_3mmD_0D_0-0.01inc_0.5dpm(high res).txt
09192022_NaCl_2mmS_3mmD_1D_0-0.05inc_0.5dpm(no shield).txt
09192022_NaCl_2mmS_3mmD_1D-0-0.05inc_0.5dpm.txt
09212022_LiF_0-2mmS_3mmD_0D_0-01inc_0-5dpm(high res).txt
09212022LiF_2mmS_3mmD_1D_0-05inc_10dpm(no shield).txt
09212022LiF_2mmS_3mmD_1D_0-05inc_10dpm(shield).txt
In any case, here is the rest of the data I was using.
ZhiweiBai commented on Apr 15, 2024
I found a solution to this problem, just upgrade the package pip install --upgrade matplotlib