-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Make autosize=True work in nbconvert slides #1664
Comments
Hi @Juanlu001, Thanks for digging into this. After trying this out, it looks like the In the meantime, I'd recommend handling this with a custom template that specifies the figure size. This way you can use this template in the default, and not need to specify anything for each figure in the notebook. Here's an example import plotly.graph_objects as go
import plotly.io as pio
# Set default renderer
pio.renderers.default = 'notebook+jupyterlab' # See [1]
# Set default template
pio.templates['slides'] = go.layout.Template(layout=dict(width=800, height=550))
pio.templates.default = 'plotly+slides' # See [2] [1] [2] The To make this more concise and reusable, you could create a See the version 4 templates documentation for more info https://plot.ly/python/next/templates/. |
Hi @jonmmease, thanks a lot for your response - I was not aware of the templates functionality, looks super powerful! Will give this a try, I'm giving a talk next week 😃 |
Just tested this solution and works like a charm ❤️ |
Came back to #1664 (comment), still works beautifully. Perhaps it could be listed in the documentation for easier access? |
Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson |
As reported in #355 and #750, plotly figures have weird sizing when appearing in slides:
This is still the case with Plotly 4.0.0rc1. The current workaround is:
(See this other issue for my current understanding of
.show()
)Another alternative is to install orca (which was a bit more difficult than I expected) and set the renderer to
svg
,png
or similar.Anyway, despite this workarounds, it would be great if
autosize=True
would work when making slideshows.The text was updated successfully, but these errors were encountered: