-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Plot in JS Animation has larger margin than "normal" PNG plot #12115
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
Comments
I suspect the issue is that notebooks by default trims excess whitespace
from static matplotlib figures. You don't want to do that in general for
animations because the amount of excess whitespace can change from frame to
frame.
…On Fri, Sep 14, 2018 at 7:31 AM Matthias Geier ***@***.***> wrote:
Bug report
*Bug summary*
A few hours ago #12098
<#12098> was merged, which
left-aligns JS Animation plots and thereby fixes #11795
<#11795>.
This brought to light another little inconsistency between JS Animations
and "normal" plots.
The PNG data in the JS Animation seems to have a larger white margin than
normal plots.
Therefore, if I plot a normal plot and then a similar JS Animation, the
plot in the JS Animation shows up a bit further right (because of the PNG
margin).
*Code for reproduction*
I'm using the examples from
https://splines.readthedocs.io/en/latest/bezier.html
*Actual outcome*
[image: grafik]
<https://user-images.githubusercontent.com/705404/45547484-3bb5c580-b821-11e8-9d56-1c992456a350.png>
*Expected outcome*
Ideally, the PNG data in the JS Animation should have the same white
margin as "normal" PNG plots.
*Matplotlib version*
- Operating system: Debian Linux
- Matplotlib version: master (848d9fc
<848d9fc>
a.k.a. 3.0.0rc1.post275+g848d9fc56)
- Matplotlib backend: module://ipykernel.pylab.backend_inline
- Python version: 3.6.6
- Jupyter version: JupyterLab 0.35.0a0
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#12115>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AARy-EmHbIjenBJXdEyFNyQvDDaUVFPtks5ua5N-gaJpZM4WpG1d>
.
|
@WeatherGod Indeed, I just checked with Any ideas how I could make this consistent? Manually remove the margins from Matplotlib plots? |
I would also think that the way to make this consistent is rather to let jupyter not crop the figure. You may use
in a cell before the plot, or generally set this option in your IPython configuration. (I don't know about the differences between juypterlab and jupyter notebook though) I think you may also use the |
Thanks @ImportanceOfBeingErnest, the suggested config setting for the I still have to look into the |
Bug report
Bug summary
A few hours ago #12098 was merged, which left-aligns JS Animation plots and thereby fixes #11795.
This brought to light another little inconsistency between JS Animations and "normal" plots.
The PNG data in the JS Animation seems to have a larger white margin than normal plots.
Therefore, if I plot a normal plot and then a similar JS Animation, the plot in the JS Animation shows up a bit further right (because of the PNG margin).
Code for reproduction
I'm using the examples from https://splines.readthedocs.io/en/latest/bezier.html
Actual outcome
Expected outcome
Ideally, the PNG data in the JS Animation should have the same white margin as "normal" PNG plots.
Matplotlib version
master
(848d9fc a.k.a.3.0.0rc1.post275+g848d9fc56
)module://ipykernel.pylab.backend_inline
The text was updated successfully, but these errors were encountered: