-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added rc parameters for tight_layout #12365
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
Conversation
added rc parameters for tight_layout padding
@@ -36,7 +36,8 @@ def _get_top(tight_bbox, axes_bbox): | |||
|
|||
def auto_adjust_subplotpars( | |||
fig, renderer, nrows_ncols, num1num2_list, subplot_list, | |||
ax_bbox_list=None, pad=1.08, h_pad=None, w_pad=None, rect=None): | |||
ax_bbox_list=None, pad=rcParams['figure.tight_layout.pad'], | |||
h_pad=rcParams['figure.tight_layout.h_pad'], w_pad=rcParams['figure.tight_layout.w_pad'], rect=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that it's quite uncommon to have the rcParams being evaluated within the function signature. I think this would at least become a problem with the rc_context manager. Better keep the paramers as None
and set the values within the function (if param is None: ...
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, this is not just uncommon, but it will not work as expected. The rcParams would be resolved when the function is read from the file but the intent is for them to be resolved when the function is called.
Can this get a test? Meaning you can test if putting some parameters into the rcParams and calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the default parameters.
@@ -36,7 +36,8 @@ def _get_top(tight_bbox, axes_bbox): | |||
|
|||
def auto_adjust_subplotpars( | |||
fig, renderer, nrows_ncols, num1num2_list, subplot_list, | |||
ax_bbox_list=None, pad=1.08, h_pad=None, w_pad=None, rect=None): | |||
ax_bbox_list=None, pad=rcParams['figure.tight_layout.pad'], | |||
h_pad=rcParams['figure.tight_layout.h_pad'], w_pad=rcParams['figure.tight_layout.w_pad'], rect=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, this is not just uncommon, but it will not work as expected. The rcParams would be resolved when the function is read from the file but the intent is for them to be resolved when the function is called.
Closing due to lack of feedback. In the current form this is not a valid solution to #5266. |
added rc parameters for tight_layout padding
PR Summary
Fixes #5266.
-added properties in matplotlibrc and rcsetup
-replaced hardcoded values in tight_layout.py with the new rc properties
PR Checklist