Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

contour for cyclic functions #20548

Closed
Closed
@nschloe

Description

@nschloe

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()

screenshot

This is with mpl 3.4.2.

Edit: A very similar report ison stackoverflow.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp