Hello,
I am trying to convert plotly chart to pdf in google colab, but it runs error.
Could you please help?
Here is the code:
import plotly.graph_objects as go
import os
#%%
fig = go.Figure(go.Bar(
x=[5, 16, 18],
y=['Others', 'NO', 'YES'],
orientation='h',
text = [5, 16, 18],
textposition='outside',
width = 0.45
))
#%%
fig.show()
#%%
if not os.path.exists("images"):
os.mkdir("images")
#%%
fig.write_image("images/fig1.pdf")
Bests,
Ditsuhi