-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Group figure.subplot.* rc to a single rcParam. #11231
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
This PR seems to restrict the subplot params into the the range [0,1]. This not useful. I don't like |
I just copied the name from |
f04d697
to
ebb16de
Compare
Uh, so maybe that validator should change. I agree that it doesn't make sense to be able to set values larger 1 only via the api but not via rc. Resons to keep it as it is:
The latter are mainly workarounds, but as long as such problems do not have a good solution (and there will always such special cases I figure) it would be a pitty to artificially limit the available options to solve them quickly. |
5955f3a
to
80b1a8e
Compare
Oh I see, the validators for hspace and wspace were just completely wrong too... killed them as well. |
6398d16
to
4e16522
Compare
The idea is to make it easier to restore a figure's subplotparams to the rc-provided defaults. Specifically, this can now be done with fig.subplots_adjust(**rcParams["figure.subplot"]) or fig.subplots_adjust(**dict(rcParams["figure.subplot"], left=...)) if some values need to be overridden. Also make Figure.clf() restore the subplotsparams to these rc-provided defaults (that is the original motivation for the change). Note that this PR runs into a limitation of the rcParams API: it would be nicer if the validators took the rcParams as parameters (e.g. implicitly by being methods of the RcParams class), so that they can actually depend on another key in the same instance.
4e16522
to
8ce5600
Compare
Since this Pull Request has not been updated in 60 days, it has been marked "inactive." This does not mean that it will be closed, though it may be moved to a "Draft" state. This helps maintainers prioritize their reviewing efforts. You can pick the PR back up anytime - please ping us if you need a review or guidance to move the PR forward! If you do not plan on continuing the work, please let us know so that we can either find someone to take the PR over, or close it. |
Just for tracking purposes, the surrounding machinery has mostly all been pr'd separately; the only question remaining is whether we want to group the rcparams into a single dict or not. (I still think this would be a good idea -- probably easiest would be to just start a new pr from scratch.) |
I think we should not do this right now. While a single dict would make some things easier, other things get hader. You'll have to write I suggest to defer this to the redesign of the config system #24585. In particular. we can build a proper hierarchial interface there, which supports both |
The idea is to make it easier to restore a figure's subplotparams to the
rc-provided defaults. Specifically, this can now be done with
or
if some values need to be overridden.
Also make Figure.clf() restore the subplotsparams to these rc-provided
defaults (that is the original motivation for the change).
Note that this PR runs into a limitation of the rcParams API: it would
be nicer if the validators took the rcParams as parameters (e.g.
implicitly by being methods of the RcParams class), so that they can
actually depend on another key in the same instance.
Also, the tests now restore original rcParams using
dict.update
toavoid revalidating them and running into the warnings.
(
rc_context.__exit__
does the same.)Alternative to #11086.
PR Summary
PR Checklist