I have a quick question. I have recently started to use plotly offline.
I am running machine learning experiments which saves huge amount of images, in the order of 100s.
I want to close the figures created using plotly.
Previously, I have used matplotlib library, where I used matplotlib.pyplot.close() to close the figures. I would like to know the equivalent of this in plotly.
Can you please help me in this regard?
This might not be possible but I would like to understand your use case a little better. How are you displaying the plotly figures (e.g. with iplot in the notebook, with plot in the browser, etc.)? In what format do you want to save them to disk (standalone HTML files, static images, etc.)?
import numpy as np
import plotly.express as px
for i in range(1000):
x = np.random.rand(6,6)
fig = px.imshow(x)
fig.show()
fig.write_image(f"mycool_array_{i}.png"
I seem to have trouble getting it to save the images properly.