Skip to content

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

Closed

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

Activity

  1. QuLogic commented on Mar 12, 2024

    @QuLogic
    Member

    I believe this was fixed by #26788, and should be working in 3.9.0

  2. added this to the v3.9.0 milestone on Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions