Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion src/gleplot/axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,9 @@ def legend(self, loc: str = "best", **kwargs):
if "offset" in kwargs:
# gleplot extension (not a matplotlib kwarg): displace the key
# from its anchor by (dx, dy) IN CM, GLE's ``key ... offset``.
# Positive dy moves DOWN from the anchor, following GLE.
# GLE displaces INWARD from the anchored corner: for pos tr,
# positive dx moves LEFT and positive dy moves DOWN (verified by
# compiled pixel-diff; negative values can leave the canvas).
offset = kwargs.pop("offset")
if offset is None:
self.legend_offset = None
Expand Down
8 changes: 6 additions & 2 deletions src/gleplot/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1382,8 +1382,12 @@ def add_legend(
``nobox``.
offset : tuple of (float, float), optional
Displacement of the key from its anchor, in cm, emitted as GLE's
``offset dx dy``. GLE's convention: positive dx moves right,
positive dy moves down from the anchor. ``None`` omits the token.
``offset dx dy``. GLE displaces the key INWARD from the anchored
corner (verified against GLE 4.3.10 by compiled pixel-diff): for a
right-anchored key positive dx moves LEFT, for a top-anchored key
positive dy moves DOWN. Negative values push the key outside the
graph and can move it off-canvas entirely. ``None`` omits the
token.

Notes
-----
Expand Down
Loading