Skip to content

[Bug]: set_theta_offset removes grid outline #26972

@am-thyst

Description

@am-thyst

Bug summary

When producing a polar plot, set_theta_offset removes the outer gridlines.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt
fig, (ax1,ax2) = plt.subplots(1,2,subplot_kw=dict(projection='polar'))

azis = np.radians(np.linspace(0,360,72)); r = np.linspace(0, 250, 250)
dats = np.random.rand(250,72)
X,Y=np.meshgrid(azis,r)

for ax in [ax1,ax2]:
    ax.contourf(X,Y,dats,cmap="RdYlBu")

ax2.set_theta_offset(1.570796327)
plt.subplots_adjust(wspace=0.5)

Actual outcome

First axis has no "set_theta_offset", which means the plot starts at 90. Second axis has "set_theta_offset", which rotates the plot to start at 0, but it removes the black outline.

image

Expected outcome

Expect ax2 above to have a black circular outline as in ax1.

Additional information

No response

Operating system

Windows

Matplotlib Version

3.7.1

Matplotlib Backend

module://matplotlib_inline.backend_inline

Python version

3.11.3

Jupyter version

6.5.4

Installation

conda

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions