Bug summary
radius range setting does not work for pcolormesh() in log polar coodinates.
Code for reproduction
%matplotlib inline import numpy as np import matplotlib.pyplot as plt r = np.geomspace(1, 100, num=10) th = np.linspace(0, 360, num=50) th = np.radians(th) v = np.random.rand(len(r), len(th)) ax = plt.subplot(1, 1, 1, projection='polar') ax.set_rlim(1, 100) ax.set_rscale('log') plt.pcolormesh(th, r, v)
Actual outcome
Expected outcome
I think the pixels should spread to the outer edge of the circle, and no warnings should be shown.
Matplotlib version
Python, jupyterlab numpy and matplotlib were installed with conda.
There's more going wrong: The radial tick labels are missing:
%matplotlib inline import numpy as np import matplotlib.pyplot as plt r = np.geomspace(1, 100, num=10) th = np.linspace(0, 360, num=50) th = np.radians(th) v = np.random.rand(len(r), len(th)) fig, (ax1, ax2) = plt.subplots(1, 2, subplot_kw={'projection' :'polar'}, figsize=(10, 5)) ax1.set_rlim(1, 100) ax1.pcolormesh(th, r, v) ax2.set_rlim(1, 100) ax2.set_rscale('log') ax2.pcolormesh(th, r, v)
Here's a diff of transData of the two versions.
I suspect that the issue is the x1=5.0 instead of x1=10.0 in the very last Bbox. Can somebody with more transform experience please check this.
I suspect this is the same bug as #24383 - I think it will be easier to fix #24383 first (there's an even simpler example of radial log scale that doesn't work there), then come back to this issue and see if it's fixed as a side effect.
Activity
timhoffm commented on Nov 18, 2018
There's more going wrong: The radial tick labels are missing:
%matplotlib inline import numpy as np import matplotlib.pyplot as plt r = np.geomspace(1, 100, num=10) th = np.linspace(0, 360, num=50) th = np.radians(th) v = np.random.rand(len(r), len(th)) fig, (ax1, ax2) = plt.subplots(1, 2, subplot_kw={'projection' :'polar'}, figsize=(10, 5)) ax1.set_rlim(1, 100) ax1.pcolormesh(th, r, v) ax2.set_rlim(1, 100) ax2.set_rscale('log') ax2.pcolormesh(th, r, v)timhoffm commented on Nov 20, 2018
Here's a diff of transData of the two versions.
I suspect that the issue is the x1=5.0 instead of x1=10.0 in the very last Bbox. Can somebody with more transform experience please check this.
dstansby commented on Dec 20, 2022
I suspect this is the same bug as #24383 - I think it will be easier to fix #24383 first (there's an even simpler example of radial log scale that doesn't work there), then come back to this issue and see if it's fixed as a side effect.