-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add rcParams for Axes(3D) parameters #25642
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
base: main
Are you sure you want to change the base?
Conversation
b03a5d7
to
4d73b6c
Compare
#axes3d.adjustable: box # {box, adjustable} | ||
#axes3d.anchor: C # {C, E, N, S, W, NE, NW, SE, SW} or two-tuple of floats |
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.
Why not inherit these from axes.adjustable
or axes.anchor
? A lot of other 3D properties fall back on this without setting an explicit 3D param.
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.
#25641 :-)
One can for sure discuss which can be the same and which are beneficial to have separately.
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.
#25641 is definitely interesting.
For this one, as defaults, maybe defaulting to what is done is 2d is useful?
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.
Sorry, I do not get it. Are you saying that if the 3D-version of the RCparam is not changed, but the 2D-version is, it should use the 2D-version? How do we know if the style-sheet has set the 3D-version to the default value or not? I may be missing something, but I didn't think it was possible to query if the param comes from the style sheet or if the default is used?
Also, wouldn't that be a bit confusing? Now we add double parameters that are also physically located quite nearby, so I guess if someone want to change the 2D-case, chances are that they will notice the 3D-case as well?
Then it may very well be that it is not worthwhile to have separate 2D and 3D versions for all parameters introduced here. aspect
and ´adjustableseems to make sense to have separately, which leaves
anchor`. That was basically just added because it ended up nearby in the code and I realized that it could be done.
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.
So, I found a few places where we do this
matplotlib/lib/mpl_toolkits/mplot3d/axis3d.py
Lines 109 to 113 in e631edb
self._axinfo.update({ | |
'axisline': { | |
'linewidth': mpl.rcParams['axes.linewidth'], | |
'color': mpl.rcParams['axes.edgecolor'], | |
}, |
wherein a 3d parameter is set on based on the value of a "2d rcparam", which is why I thought we can use mpl.rcParams['axes.anchor']
directly.
Now, I personally would prefer more rcParams instead of less with inheritance as you mentioned, but I brought it up because there were some such examples. Am not opposed to adding the new rcParams though.
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.
OK, then I understand. Yes, it is not a problem as such, more a question of which parameters we would like to separate.
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.
Yes. But I guess that's a part of a bigger conversation about the role of rcparams itself. For now, I don't mind having all 3 separate parameters either.
Converting to draft as I added
|
PR Summary
Add separate rcParams for Axes and Axes3D for
aspect
,anchor
, andadjustable
. Alsoproj_type
for Axes3D.Closes #8088
PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst