Skip to content

Commit d5ac5ef

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 e9d95f3 commit d5ac5ef

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
@@ -486,6 +486,11 @@ def _draw_panel_borders(self):
486486
# grid lines below the borders. We leave ax.patch for the
487487
# background only.
488488
if self.theme.T.is_blank("panel_border"):
489+
# For PolarAxes the default circular spine is separate from the
490+
# panel border Rectangle; hide it explicitly when blank.
491+
for ax in self.axs:
492+
if "polar" in ax.spines:
493+
ax.spines["polar"].set_visible(False)
489494
return
490495

491496
from matplotlib.patches import Rectangle

0 commit comments

Comments
 (0)