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 summary
This example causes matplotlib to silently crash on Windows, but not on Mac. The example below is a minimal example. Looks like important detail is that the data extends below the radial axis minimum limit.
I have another bug related to log scale polar axes, these might be related:
Code for reproduction
importsysimportmatplotlibasmplimportmatplotlib.pyplotaspltimportnumpyasnpdefplot():color_step=3fontsize_y=8# Create a polar plotfig=plt.figure(figsize=(10,10))ax=fig.add_subplot(111,projection="polar")ax.set_rscale("log")# KEY LINE!!!!!!!!!!!1# Crashes in windows if lower limit is higher than lower datapoint.ax.set_rlim(101,20000)n_angles=3n_freqs=10_angles=np.linspace(0,180,n_angles)Angles=_angles[:,np.newaxis]*np.ones(n_freqs)# KEY LINE# Lower r_axis value is 100, which is lower than low axis limit.freqs=np.linspace(100,1000,n_freqs)Freqs=np.ones((n_angles,1))*freqs[:,np.newaxis].Tprint(freqs)Mags=np.random.rand(*Freqs.shape)*100colormesh=ax.pcolormesh(# Angle / 57.29,Angles/57.29,Freqs,Mags,shading="gouraud",# cmap=colormap,# vmin=color_lo,# vmax=color_hi, )plt.show()if__name__=="__main__":plot()
Actual outcome
Plot window briefly shows, then disappears. I tried a couple version of Python and three backends. Crash occurs on plt.show or plt.savefig
Expected outcome
Plot displays. (works on Mac)
Additional information
No response
Operating system
No response
Matplotlib Version
3.7.3
Matplotlib Backend
QtAgg
Python version
3.8
Jupyter version
No response
Installation
pip