| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| If 'box', change the physical dimensions of the Axes. | ||
| If 'datalim', change the ``x`` or ``y`` data limits. | ||
| If 'datalim', change the ``x`` or ``y`` data limits. This | ||
| may ignore explicitly defined axis limits. |
There was a problem hiding this comment.
Note: I've intentionally written may because in the current implementation one can have scenarios where the limits are respected. For example
fig, ax = plt.subplots()
ax.set_aspect('equal', 'datalim')
ax.plot([0, 1], [0, 2])
ax.set_ylim(-5, 5)
Just looking at the data, the y-range is larger, so to get all data shown on equal aspect, x has to be increased. Thus, new xlims are calculated, but taking the ylim (not the ydata) into account. Whether this behavior of sometimes taking limits into account and sometimes not is desireable, is a separate question that I don't want to discuss. The doc now only states that it may (or may not) happen. Note however, that the added runtime warning is precise: It will be emitted exactly if we change previously fixed limits.
Sorry, something went wrong.
|
I do not think users will see this by default (or I may be confused about logging)? |
Sorry, something went wrong.
|
I also am not sure that we want to backport this. It is a minor change to long standing behavior. |
Sorry, something went wrong.
I checked in my dev environment (don't think I've configured something special there): python shell, ipython shell, python script all show this. Alternative would be warnings.warn. From [logging tutorial(https://docs.python.org/3/howto/logging.html#logging-basic-tutorial)
That's the question: Do we see this as a misuse and want users to change their code? Or do we only want to inform? Given the somewhat peculiar behavior that this warning depends on the set limits and used data, I've been hesitant to request a code change, even if that means some logging configuration may not show the message.
No strong opinion. I've mainly target 3.9.x to get the doc hint in. But we can also target 3.10. |
Sorry, something went wrong.
There was a problem hiding this comment.
Approved during discussion in community call
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #28673.