Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
83c906f
Move axes setup to coord classes
iangow May 27, 2026
9f0c75d
feat(scale): add position support to scale_xy
has2k1 Jun 19, 2026
1692256
feat(coord): setup_ax owns side config; per-side axis-title targets
has2k1 Jun 19, 2026
b360e02
feat(theme): side-scoped axis themeables; coord_flip rotates position
has2k1 Jun 19, 2026
7e72b5d
feat(facet): place moved axis on the resolved edge panels
has2k1 Jun 19, 2026
c1c74c3
feat(layout): allocate per-side axis space and place titles for moved…
has2k1 Jun 19, 2026
78434dc
feat(theme): use the geometric panel-facing margin for moved axes
has2k1 Jun 22, 2026
a3d0624
test(baseline): add moved-axis baselines; update theme_seaborn
has2k1 Jun 22, 2026
6fe9d32
refactor: replace get_opposite_side with OPPOSITE_SIDE; add MARGIN_SIDE
has2k1 Jun 22, 2026
a42a94d
feat(theme): expose per-side axis themeables as theme() arguments
has2k1 Jun 22, 2026
ab79c9e
refactor(theme): apply the axis-text margin in the axis_text themeable
has2k1 Jun 22, 2026
e5140e4
refactor(coord): make setup_ax theme-free and data-drive tick activation
has2k1 Jun 22, 2026
b38d1a4
docs(theme): document the cooperative apply/blank super() chain
has2k1 Jun 22, 2026
cdc39aa
refactor(scale): type Scales.x/.y as concrete position scales
has2k1 Jun 22, 2026
ae0c3c0
refactor(facet): pass axis positions into compute_layout
has2k1 Jun 22, 2026
c2367dd
feat(scale): add Scales.axis_positions property
has2k1 Jun 22, 2026
43e20a1
refactor(facet): pass scales into compute_layout
has2k1 Jun 22, 2026
1283313
docs(changelog): add entry for axis position feature
has2k1 Jun 23, 2026
f2acb48
chore: remove unused import and obsolete pyright ignores
has2k1 Jun 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/changelog.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ title: Changelog
- Added [](:class:`~plotnine.composition.inset_element`) with which you can insert plot
compositions or images into another plot.

- Position scales gained a `position` parameter, so you can move an axis to the
opposite side of the panel. Use `position="top"` for the x axis and
`position="right"` for the y axis.

```python
ggplot(df, aes("x", "y")) + geom_point() + scale_x_continuous(position="top")
```

Each axis side can be styled independently with new per-side themeables, e.g.
`axis_text_x_top`, `axis_title_y_right`, `axis_line_x_top` and
`axis_ticks_major_y_right`.

```python
theme(axis_text_x_top=element_text(color="blue"))
```

### API Changes

- Removed `geom.to_layer()`, `stat.to_layer()`, `annotate.to_layer()`,
Expand Down
7 changes: 6 additions & 1 deletion plotnine/_mpl/layout_manager/_layout_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,12 @@ def align_axis_titles(self):
def axis_title_clearance(s):
return s.axis_title_clearance

for spaces in [self.bottom_spaces, self.left_spaces]:
for spaces in [
self.bottom_spaces,
self.left_spaces,
self.top_spaces,
self.right_spaces,
]:
_align(spaces, axis_title_clearance, "axis_title_alignment")

for tree in self.sub_compositions:
Expand Down
Loading
Loading