Skip to content

feature request: when downloading plot as png using the modebar button, use the current size of the plot as the size of the png #1576

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

Closed
finger563 opened this issue Apr 10, 2017 · 6 comments · Fixed by #5209
Labels
bug something broken

Comments

@finger563
Copy link

Currently it does not use the size of the plot as it has been rendered into the browser. The data ranges and such are all the same, but since the size is different the legend may overlap parts that it did not when viewed in the browser and the aspect ratio may be different.

@etpinard
Copy link
Contributor

Unfortunately, that's more like a backward-incompatible change than a feature request. If we do choose to do this, we'll have to wait for v2.

In the meantime, here's a workaround: http://codepen.io/etpinard/pen/NpvYOo

@etpinard etpinard added this to the v2.0.0 milestone Apr 10, 2017
@finger563
Copy link
Author

Thanks for the feedback and adding my own options to that code snippet worked well :)

@ijustmadethisforplotly
Copy link

Is there any progress on this feature?- It kinda seems important to be able to save your plots as an png :)

@ijustmadethisforplotly
Copy link

Bump

@nicolaskruchten
Copy link
Contributor

@etpinard would this really be a "breaking" change? In what scenarios would this not be a net improvement over the current arbitrary dimensions of the downloaded PNG when no width/height are set?

@etpinard
Copy link
Contributor

etpinard commented Apr 8, 2019

#3746 add a JSON-serializable way to do effectively what is presented in #1576 (comment)


Next, as @antoinerg points out in #3746 (comment), maybe we could:

Could config options toImageButtonOptions: {width: null, height: null} be the default when responsive: true?

in v2, or better yet make {width: null, height: null} the default behavior in v2 when Plotly.toImage is called with an existing graph div as first argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants