-
-
Notifications
You must be signed in to change notification settings - Fork 8k
MNT/DOC: Deprecate anchor in Axes3D.set_aspect #30408
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,7 +244,7 @@ def _transformed_cube(self, vals): | |
(minx, maxy, maxz)] | ||
return proj3d._proj_points(xyzs, self.M) | ||
|
||
def set_aspect(self, aspect, adjustable=None, anchor=None, share=False): | ||
def set_aspect(self, aspect, adjustable=None, anchor=None): | ||
""" | ||
Set the aspect ratios. | ||
|
@@ -263,39 +263,26 @@ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False): | |
'equalyz' adapt the y and z axes to have equal aspect ratios. | ||
========= ================================================== | ||
adjustable : None or {'box', 'datalim'}, optional | ||
If not *None*, this defines which parameter will be adjusted to | ||
meet the required aspect. See `.set_adjustable` for further | ||
details. | ||
anchor : None or str or 2-tuple of float, optional | ||
If not *None*, this defines where the Axes will be drawn if there | ||
is extra space due to aspect constraints. The most common way to | ||
specify the anchor are abbreviations of cardinal directions: | ||
===== ===================== | ||
value description | ||
===== ===================== | ||
'C' centered | ||
'SW' lower left corner | ||
'S' middle of bottom edge | ||
'SE' lower right corner | ||
etc. | ||
===== ===================== | ||
``adjustable`` : {'box', 'datalim'}, default: 'box' | ||
` Which parameter to adjust to meet the aspect ratio. | ||
- 'box': Change the physical dimensions of the axes bounding box. | ||
- 'datalim': Change the x, y, or z data limits. | ||
See `~.Axes.set_anchor` for further details. | ||
share : bool, default: False | ||
If ``True``, apply the settings to all shared Axes. | ||
``anchor`` : None or str or 2-tuple of float, optional | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this changed to code style? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added the double backticks here for the same reason as for the adjustable parameter: to resolve a documentation build failure that was happening in the CI. |
||
.. deprecated:: 3.11 | ||
The *anchor* parameter is not used for 3D axes and will be | ||
removed in a future version. It is ignored. | ||
See Also | ||
-------- | ||
mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect | ||
""" | ||
if anchor is not None: | ||
_api.warn_deprecated("3.11", name="anchor", removal="3.13") | ||
_api.check_in_list(('auto', 'equal', 'equalxy', 'equalyz', 'equalxz'), | ||
aspect=aspect) | ||
super().set_aspect( | ||
aspect='auto', adjustable=adjustable, anchor=anchor, share=share) | ||
if adjustable is not None: | ||
self.set_adjustable(adjustable) | ||
self._aspect = aspect | ||
|
||
if aspect in ('equal', 'equalxy', 'equalxz', 'equalyz'): | ||
|
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 did you delete
share
?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.
Hello! I removed the share parameter because it was only being passed to the super().set_aspect() call.
During local testing, I found that the super() call was causing an ImageComparisonFailure in the existing test_aspects test. Based on the original issue's suggestion and that test failure, I removed the super() call entirely. Since share was no longer being used anywhere inside the method, I removed it from the signature and docstring as well to clean up the unused code.
Please let me know if you think it should be handled differently