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
[Bug]: inconsistency between inline
and other backends (ipympl
, qt
)
#23731
Comments
This is because as part of switching to the backend The way that inline works is that it saves the figure to a buffer and then injects the base64 encoded png into the notebook in a dataurl. In the rest of the backends we use a lower level method of drawing that does not consider than rcparam. Setting this rcparam back to |
okay, it sounds like that this is a desired behaviour then? Would it be worth to inform the user with a warning that some artists are clipped when this happen? |
In general clipping is expected (for example if you zoom), I think we would have far more false-positives than true-positives if we started to warn. |
To be clear, Matplotlib isn't doing this, ipython is doing this in the in-line backend. I think the odds of ipython changing this after having this as a the default for so long. If you are doing tests you can disable this. https://stackoverflow.com/questions/26714626/how-to-disable-bbox-inches-tight-when-working-with-matplotlib-inline-in-ipytho |
This is an unfortunate behavior of the inline backend. But I see no way to how we or ipython can improve the situation annoying a lot of users one way (changing behavior) or the other (printing noisy information). Basically the only option would be to introduce a new backend name other than |
Bug summary
There is an inconsistency between backends,
inline
versusqt
/ipympl
with respect to what artists need to be included in the figure.xref hyperspy/hyperspy#2991.
Code for reproduction
Actual outcome
Give the following error with the
inline
backend and works fine with theqt
oripympl
backend, because theinline
include the test in the figure, while theqt
oripympl
backend doesn't.Expected outcome
With respect to include or not the test in the figure, the backend should behave consistently.
Additional information
No response
Operating system
Windows
Matplotlib Version
3.5.3
Matplotlib Backend
inline
Python version
3.9
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: