I’ve created a visualization that is broken up into a 5x3 grid of subplots. I’m able to get this to display properly by specifying a larger height via the layout. The issue is that when I use the “download as png” function, that it exports the image with the default height, not the new height. The result is a figure that’s completely illegible and squished.
Not sure if this is relevant, but I’m generating the plots using add_trace and changing the layout with update_layout methods.
I was able to get the code to work as a plotly graph in jupyter with slight modification for Python:
fig.show(config={‘toImageButtonOptions’: {‘width’: None,‘height’: None}})
However, for my application in Dash the code does not work. I’m populating the graph in a callback by returning my populated “fig” variable as an output. Just adding the line above to the callback before the return doesn’t seem to work. Maybe the fig.show() command doesn’t really make sense for a graph that’s displayed outside of the function call?
For a Dash app, the dcc.Graph has a config attribute, so you can pass the above config dictionary to dcc.Graph instead of fig.show. Indeed, fig.show should not be called in a Dash app.