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
Description
Bug summary
When I used surface_plot function with matplotlib version 3.6.2 on MacOS to draw a 3D image, nothing appears even the axis.
When I tried to degrade matplotlib to 3.5 and run the same code, it works.
Code for reproduction
importnumpyasnpimportmatplotlib.pyplotaspltfrommpl_toolkits.mplot3dimportAxes3Dfromscipy.statsimportmultivariate_normaldefGaussian_Distribution(N=2,M=1000,m=0,sigma=1):mean=np.zeros(N)+mcov=np.eye(N)*sigmadata=np.random.multivariate_normal(mean,cov,M)Gaussian=multivariate_normal(mean=mean,cov=cov)returndata,GaussianM=100data,Gaussian=Gaussian_Distribution(N=2,M=M,sigma=0.1)X,Y=np.meshgrid(np.linspace(-1,1,M),np.linspace(-1,1,M))d=np.dstack([X,Y])Z=Gaussian.pdf(d).reshape(M,M)fig=plt.figure(figsize=(6,4))ax=Axes3D(fig)ax.plot_surface(X,Y,Z,rstride=1,cstride=1,cmap='seismic',alpha=0.8)ax.set_xlabel('X')ax.set_ylabel('Y')ax.set_zlabel('Z')plt.savefig('123.png')plt.show()
Actual outcome
Expected outcome
Additional information
No response
Operating system
No response
Matplotlib Version
3.6.2
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
Metadata
Metadata
Assignees
Labels
No labels