8000 [Bug]: calling title before making polar plot · Issue #28944 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
[Bug]: calling title before making polar plot #28944
Closed
@exekerey

Description

@exekerey

Bug summary

Hi, sorry to bother if it is not an issue at all.
Setting title first and then making polar plot messes up the plot and it makes the plot in usual cartesian plane

Code for reproduction

import matplotlib.pyplot as plt

theta = [0, 1, 2, 3, 4, 5, 6]
r = [0, 1, 0.5, 1, 0.5, 1, 0]

plt.title("stuff")
plt.polar(theta, r)
plt.show()

Actual outcome

It outputs a warning:
<stdin>:1: UserWarning: Trying to create polar plot on an Axes that does not have a polar projection.
And makes the plot:
image

Expected outcome

Although the plot should have look like this:
image

Additional information

No response

Operating system

OS/X

Matplotlib Version

3.9.0

Matplotlib Backend

macosx

Python version

Python 3.12.0

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0