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
Description
I tried to get a contour plot of the complex angles of a particular function, but always got one level too many around zeros and infinities. Consider the following MWE which is supposed to plot the contour line forpi / 4
only. It plotspi / 4
alright, but alsopi
.
importnumpyasnpimportmatplotlib.pyplotaspltxmin,xmax=-3.0,3.0ymin,ymax=-3.0,3.0nx,ny=500,500x=np.linspace(xmin,xmax,nx)y=np.linspace(ymin,ymax,ny)X,Y=np.meshgrid(x,y)fZ=np.angle(X+1j*Y)plt.contour(X,Y,fZ,levels=[0.25*np.pi],colors="k")plt.gca().set_aspect("equal")plt.show()
This is with mpl 3.4.2.
Edit: A very similar report ison stackoverflow.