-
-
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
Draft
oscargus
wants to merge
1
commit into
matplotlib:main
Choose a base branch
from
oscargus:axesrcparams
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
New rcParams for Axes creation | ||
------------------------------ | ||
|
||
A number of rcParams are introduced to control parts of the Axes creation. | ||
For a standard 2D Axes, the following are introduced: | ||
|
||
* :rc:`axes.adjustable`, see `.Axes.set_adjustable` | ||
* :rc:`axes.anchor`, see `.Axes.set_anchor` | ||
* :rc:`axes.aspect`, see `.Axes.set_aspect` | ||
* :rc:`axes.box_aspect`, see `.Axes.set_box_aspect` | ||
|
||
There are separate parameters for 3D Axes, including an additional 3D-specific one: | ||
|
||
* :rc:`axes3d.adjustable`, see `.Axes.set_adjustable` | ||
* :rc:`axes3d.anchor`, see `.Axes.set_anchor` | ||
* :rc:`axes3d.aspect`, see `.Axes3D.set_aspect` | ||
* :rc:`axes3d.box_aspect`, see `.Axes3D.set_box_aspect` | ||
* :rc:`axes3d.proj_type`, see `.Axes3D.set_proj_type` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
oraxes.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
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.