E541 Feature Add: re-factor BBox padding by zhaowei-wang · Pull Request #11794 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Conversation

zhaowei-wang
Copy link
@zhaowei-wang zhaowei-wang commented Jul 29, 2018

Feature Add: In response to Issue #11764, re-factor of how Bbox class assigns padding in order to extend to non-symmetric padding on all sides. If optional argument pad_inches is a 4-tuple, assign in the following orientation in inches (LEFT, RIGHT, TOP, BOTTOM), otherwise if single value P pad with (P, P, P, P).

Test code below:

import numpy as np
import matplotlib.pyplot as plt

# evenly sampled time at 200ms intervals
t = np.arange(0., 5., 0.2)

# red dashes, blue squares and green triangles
plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^')
plt.savefig("test.png", bbox_inches='tight', pad_inches=1)
plt.savefig("test2.png", bbox_inches='tight', pad_inches=(1,2,3,4))

… assigns padding in order to extend to non-symmetric padding on all sides.
@timhoffm
Copy link
Member

Thanks for the contribution.

This adresses #11764.

How to provide the padding information is an important API decision, with which we are not clear yet ourselves (see #11764). Once that's done, we'll come back for review. Thanks for your patience.

@jklymak jklymak changed the title Feature Add: Issue #11764, re-factor BBox padding Feature Add: re-factor BBox padding Aug 4, 2018
@jklymak
Copy link
Member
jklymak commented Jul 16, 2020

Thanks @zhaowei-wang I think we decided on a dict API. I'll close this, but anyone should feel free to add a dict API, including you!. Sorry this sat for so long.

@jklymak jklymak closed this Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0