Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
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.
importmatplotlib.pyplotaspltimportnumpyasnpfrommatplotlib.gridspecimportGridSpecnbins=50data=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)foriinrange(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