Skip to content
Draft
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
5 changes: 5 additions & 0 deletions lib/matplotlib/gridspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ def get_grid_positions(self, fig):

fig_tops, fig_bottoms = (top - cell_hs).reshape((-1, 2)).T
fig_lefts, fig_rights = (left + cell_ws).reshape((-1, 2)).T

# avoid floating-point precision where A + (B - A) does not equal B

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe worth a comment that this is the same strategy (brutally forcing the value of the last point) as the one employed by linspace, from a quick skim at their implementation.

In general the patch looks fine to me.

fig_bottoms[-1] = bottom
fig_rights[-1] = right

return fig_bottoms, fig_tops, fig_lefts, fig_rights

@staticmethod
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def test_str_transform():
[-- --]])))),
BboxTransformTo(
TransformedBbox(
Bbox(x0=0.125, y0=0.09999999999999998, x1=0.9, y1=0.9),
Bbox(x0=0.125, y0=0.1, x1=0.9, y1=0.9),
BboxTransformTo(
TransformedBbox(
Bbox(x0=0.0, y0=0.0, x1=8.0, y1=6.0),
Expand Down
Loading