Skip to content

Copy-edit the docstring of AuxTransformBox. #30236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025
Merged
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
32 changes: 15 additions & 17 deletions lib/matplotlib/offsetbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def _get_aligned_offsets(yspans, height, align="baseline"):

class OffsetBox(martist.Artist):
"""
The OffsetBox is a simple container artist.
A simple container artist.

The child artists are meant to be drawn at a relative position to its
parent.
Expand Down Expand Up @@ -826,17 +826,18 @@ def draw(self, renderer):

class AuxTransformBox(OffsetBox):
"""
Offset Box with the aux_transform. Its children will be
transformed with the aux_transform first then will be
offsetted. The absolute coordinate of the aux_transform is meaning
as it will be automatically adjust so that the left-lower corner
of the bounding box of children will be set to (0, 0) before the
offset transform.

It is similar to drawing area, except that the extent of the box
is not predetermined but calculated from the window extent of its
children. Furthermore, the extent of the children will be
calculated in the transformed coordinate.
An OffsetBox with an auxiliary transform.

All child artists are first transformed with *aux_transform*, then
translated with an offset (the same for all children) so the bounding
box of the children matches the drawn box. (In other words, adding an
arbitrary translation to *aux_transform* has no effect as it will be
cancelled out by the later offsetting.)

`AuxTransformBox` is similar to `.DrawingArea`, except that the extent of
the box is not predetermined but calculated from the window extent of its
children, and the extent of the children will be calculated in the
transformed coordinate.
"""
def __init__(self, aux_transform):
self.aux_transform = aux_transform
Expand All @@ -853,10 +854,7 @@ def add_artist(self, a):
self.stale = True

def get_transform(self):
"""
Return the :class:`~matplotlib.transforms.Transform` applied
to the children
"""
"""Return the `.Transform` applied to the children."""
return (self.aux_transform
+ self.ref_offset_transform
+ self.offset_transform)
Expand Down Expand Up @@ -908,7 +906,7 @@ def draw(self, renderer):

class AnchoredOffsetbox(OffsetBox):
"""
An offset box placed according to location *loc*.
An OffsetBox placed according to location *loc*.

AnchoredOffsetbox has a single child. When multiple children are needed,
use an extra OffsetBox to enclose them. By default, the offset box is
Expand Down
Loading