Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: polygon from axvspan not correct in polar plot after set_xy #27824

Closed
@keatonb

Description

@keatonb

Bug summary

When updating vertices of polygon produced with axvspan on polar axes, the resultant polygon does not seem to follow the polar projection.

Code for reproduction

import matplotlib.pyplot as plt

fig, axs = plt.subplots(1, 2, subplot_kw={'projection': 'polar'})

# What I expect
polygon1 = axs[0].axvspan(0,np.pi/2)
axs[0].set_title("What I expect")

# What I get
polygon2 = axs[1].axvspan(0,np.pi/2)
polygon2.set_xy(polygon2.get_xy()) #this should not change the polygon data
axs[1].set_title("What I get")

plt.show()

Actual outcome

Figure 19

Expected outcome

I expect that polygon2.set_xy(polygon2.get_xy()) should not change the polygon.

Additional information

No response

Operating system

OS X

Matplotlib Version

3.8.0

Matplotlib Backend

module://ipympl.backend_nbagg

Python version

Python 3.11.5

Jupyter version

7.0.6

Installation

conda

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions