-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
the limits of axes are inexact with mplot3d #18052
Copy link
Copy link
Closed
Labels
API: changesChanges to the public API, typically requiring deprecation.Changes to the public API, typically requiring deprecation.API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …Consistency of the matplotlib API, including naming, behavior, defaults, …Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesstatus: confirmed bugtopic: mplot3d
Milestone
Metadata
Metadata
Assignees
Labels
API: changesChanges to the public API, typically requiring deprecation.Changes to the public API, typically requiring deprecation.API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …Consistency of the matplotlib API, including naming, behavior, defaults, …Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesstatus: confirmed bugtopic: mplot3d
Type
Fields
Give feedbackNo fields configured for issues without a type.
I take an example from
https://stackoverflow.com/questions/23951230/python-axis-limit-in-matplotlib
In mplot3d, when you set, for example,
set_xlim(0, 0.8), the outcome has an extra likeset_xlim(0 - eps, 0.8 + eps), where eps is related todeltas.matplotlib/lib/mpl_toolkits/mplot3d/axis3d.py
Line 187 in 6e76411
To show the exact lims, you have to change
deltasto, for example,0 * (maxs - mins) / 12.You need something to set exact lims without touching the inside of matplotlib.
Code for reproduction
Actual outcome

Matplotlib version
The problem was discussed many times in STACK OVERFLOW:
https://stackoverflow.com/questions/23951230/python-axis-limit-in-matplotlib
https://stackoverflow.com/questions/46380464/matplotlib-3d-axis-bounds-always-too-large-doesnt-set-lims-correctly
https://stackoverflow.com/questions/16488182/removing-axes-margins-in-3d-plot