I’m recently starting to work with plotly libraries. I’m able to generate my treemap and see it by ‘show.fig’. Unfortunately, though, all the methods that I’ve tested to export the treemap so far are not working (e.g., kaleido). I’m making all the scripts in jupyter, but I also already tried it with python in the terminal. Basically, when I give the command “write_table” the jupyter notebook will be running “forever”, but not exporting the treemap to a png image file. It might be a silly thing (that I’m missing), but it would be nice if you could help me!
Bellow goes my code:
import plotly.express as px import plotly.graph_objects as go import numpy as np import pandas as pd from kaleido.scopes.plotly import PlotlyScope from dash import Dash, dcc, html, Input, Output from base64 import b64encode exemple_1 = pd.read_csv('exemple_1.csv') fig = px.treemap(exemple_1, path=[px.Constant("clusters"),'Cluster', 'parameter_1'], values='parameter_2', color='parameter_3', hover_data=['parameter_4'], color_continuous_scale='RdBu') fig.update_layout(margin = dict(t=50, l=25, r=25, b=25)) fig.show() fig.write_image("exemple_1.png") #from this part on my jupyter notebook will be running "forever", but not exporting the respective png image