Skip to content

DOC: fix layout pad #25031

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion lib/matplotlib/_constrained_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def do_constrained_layout(fig, h_pad, w_pad,
Renderer to use.

h_pad, w_pad : float
Padding around the axes elements in figure-normalized units.
Padding around the axes elements in inches.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one was correct, because the layout engine does the normalisation before calling this function

# pads are relative to the current state of the figure...
w_pad = self._params['w_pad'] / width
h_pad = self._params['h_pad'] / height
return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
wspace=self._params['wspace'],
hspace=self._params['hspace'],
rect=self._params['rect'],
compress=self._compress)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

....oh, thats why its so confused. OK, I'll look into it more carefully.


hspace, wspace : float
Fraction of the figure to dedicate to space between the
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/layout_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def __init__(self, *, h_pad=None, w_pad=None,
Parameters
----------
h_pad, w_pad : float
Padding around the axes elements in figure-normalized units.
Padding around the axes elements in inches.
Copy link
Member

@rcomer rcomer Jan 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did this one at #24981

Edit: sorry I just noticed you are targetting this for 3.7. So this one stands 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't being that subtle - I didn't catch that it was done in #24981.

Default to :rc:`figure.constrained_layout.h_pad` and
:rc:`figure.constrained_layout.w_pad`.
hspace, wspace : float
Expand Down