Skip to content

The Image downloaded using the "download as png" button is distorted #5202

Description

@FelixBenning
importnumpyasnpnp.random.seed(123)
importplotly.expressaspximportplotly.subplotsassubplotsfromkeras.datasetsimportmnist# from keras.datasets import fashion_mnist as mnist
(X_train, y_train), (X_test, y_test) =mnist.load_data()
fig=subplots.make_subplots(rows=2, cols=5)
forn, imageinenumerate(X_train[:10]):
fig.add_trace(px.imshow(255-image).data[0], row=int(n/5)+1, col=n%5+1)
layout=px.imshow(X_train[0], color_continuous_scale='gray').layoutfig.layout.coloraxis=layout.coloraxisfig.update_xaxes(**layout.xaxis.to_plotly_json())
fig.update_yaxes(**layout.yaxis.to_plotly_json())
fig.show()

this results in this (screenshot):

screenshot

download as png results in this:
download as png

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions