Skip to content

Commit

Permalink
Fix zorder of the adjust_text arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Dec 20, 2024
1 parent efe7cdd commit af503e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion doc/changelog.qmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
title: Changelog
---
## v0.14.5
(not-yet-released)

- Fixed [](:class:`~plotnine.geom_text`) with `adjust_text` so that the
the arrows are drawn between layers with the text/label on top.

## v0.14.4
(not-yet-released)
(2024-16-26)

### Bug Fixes

Expand Down
4 changes: 3 additions & 1 deletion plotnine/geoms/geom_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ def do_adjust_text(
# invisible. A good default for this usecase is the size of
# text.
"mutation_scale": size,
"zorder": zorder,
# The zorder is of the text / label box, we want the arrow to
# be between the layer before the text and the text.
"zorder": zorder - 0.5,
}
params = _default_params | params
params["arrowprops"] = _default_arrowprops | params.get("arrowprops", {})
Expand Down

0 comments on commit af503e2

Please sign in to comment.