Closed
Description
Bug report
When saving a png of a polar plot with the r-origin set "by hand," saving the result as a png plot doesn't work as expected. Saving it as PDF works as expected. Working interactively and saving it with the UI as a png works as expected.
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.gridspec import GridSpec
nbins = 50
data = np.random.randint(0, 42, nbins)
fig = plt.figure()
ax_g = fig.add_subplot(polar=True, facecolor="none")
theta = np.array(
[np.pi/2-i*2*np.pi/len(data) for i in range(len(data))])
lines = ax_g.plot(theta, data)
ax_g.set_rorigin(-78) # Replacing this with ax_g.set_rmin works as expected, so the problem comes from this line.
fig.savefig("bug.png")
fig.savefig("bug.pdf")
Actual outcome
Expected outcome
Matplotlib version
- Operating system: Ubuntu
- Matplotlib version: 3.2.1
- Matplotlib backend (
print(matplotlib.get_backend())
): TkAgg (tried with Agg, and other backends) - Python version: 3.8.2
- Jupyter version (if applicable): NA
- Other libraries: NA