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

[Bug]: Gauraud shading does not work correctly with polar plots #28373

Open
@tom-new

Description

@tom-new

Bug summary

When usingshading='gouraud' with tripcolour on an axis with polar projection, the data does not plot correctly.

Code for reproduction

importnumpyasnpimportpyvistaaspvfromscipy.spatialimportDelaunayimportmatplotlib.pyplotaspltfrommatplotlib.triimportTriangulation# create disk meshdisk=pv.Disc(center=(0.,0.,0.),inner=1.22,outer=2.22,normal=(0.,0.,1.),r_res=64,c_res=360)points=disk.points[:,:2]# create sample datadata=np.exp(-np.power((np.linalg.norm(points,axis=1)-1.72)/0.25,2.)/2.)# triangulatetess=Delaunay(points)r=np.linalg.norm(points,axis=1)theta=np.arctan2(points[:,1],points[:,0])triang=Triangulation(x=theta,y=r,triangles=tess.simplices)fig,ax=plt.subplots(1,2,subplot_kw={'projection':'polar'})ax[0].tripcolor(triang,data,shading='gouraud')ax[0].set_title('gouraud')ax[1].tripcolor(triang,data,shading='flat')ax[1].set_title('flat')plt.show()

Actual outcome

As can be seen in the image produced by the code, Gouraud shading (left) does not properly plot in polar coordinates. Flat shading (right) works as expected.

gouraud

Expected outcome

The left plot should look basically the same as the right plot.

Additional information

As far as I know, this worked fine about a month ago. However, when I reverted my Python environment to one from March, the issue persisted.

Operating system

Reproduced on both macOS and Windows

Matplotlib Version

3.8.4

Matplotlib Backend

MacOSX

Python version

3.11.8

Jupyter version

No response

Installation

conda

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