-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
The Image downloaded using the "download as png" button is distorted #5202
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
This will get easier once we merge plotly/plotly.py#2746 :) To get the "download plot" dimensions to match the figure dimension, you'll need to set some |
@alexcjohnson this is one of the things I would consider changing immediately and not waiting for a v2 ... Is there really any case where the current behaviour is better than the one where we force width/height to match? |
I am not so much concerned about the dimensions of the entire image. I am mostly concerned with the fact that layout.XAxis({
'constrain': 'domain', 'scaleanchor': 'y'
}) is not respected in the downloaded png. As the y axis is sometimes considerably taller than the x axis. And the subplots all have the same size in the displayed version but not in the downloaded version. Those are things that should not be "customization" of the download. If I am setting layout settings, I would expect them to be the default settings for the download as well. |
So the problem here is that you're constraining all the X axes to the same Y axis via fig.for_each_xaxis(lambda axis: axis.update(scaleanchor=axis.anchor)) The reason this works is that Again note that none of this will be necessary once we get plotly/plotly.py#2746 rolled in, and we'll get axis-matching in with that approach as well (i.e. zooming or panning in one subplot will zoom/pan the others, which is currently impossible) |
(cc @emmanuelle you might find this interesting/infuriating ;) |
Agreed - as long as we honor explicit width & height provided with the download config, I'd be happy to set the default to match the displayed plot, no need to consider that a breaking change. |
The download-size issue is essentially #1576, so I'll close this for now. |
this results in this (screenshot):
download as png results in this:

Tangential: It is also way too complicated to generated a small preview selection of pictures. If there is an easier method please answer this stack overflow question
The text was updated successfully, but these errors were encountered: