Skip to content

Commit 0bc2247

Browse files
iangowclaude
andcommitted
Hide polar spine when panel_border=element_blank()
For PolarAxes the outer circle is ax.spines['polar'], which is separate from the rectangular panel_border patch used for Cartesian axes. When panel_border is blank, explicitly hide the polar spine so the theme element works consistently for polar and Cartesian plots. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 173bbe7 commit 0bc2247

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

plotnine/ggplot.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,11 @@ def _draw_panel_borders(self):
485485
# grid lines below the borders. We leave ax.patch for the
486486
# background only.
487487
if self.theme.T.is_blank("panel_border"):
488+
# For PolarAxes the default circular spine is separate from the
489+
# panel border Rectangle; hide it explicitly when blank.
490+
for ax in self.axs:
491+
if "polar" in ax.spines:
492+
ax.spines["polar"].set_visible(False)
488493
return
489494

490495
from matplotlib.patches import Rectangle

0 commit comments

Comments
 (0)