Open zhimin-z opened 1 year ago
Similar to https://github.com/plotly/plotly.py/issues/3469, any idea? @nicolaskruchten @chriddyp @jonmmease
Do you have any updates on this?
Sorry but we don't have updates on this issue as of yet.
I see a similar issue when exporting to pdf. Nearly 2 years ago, the following worked for me:
# -------------------------- first time -------------------------- #
import plotly.express as px
import time
file_Name="some_Figure.pdf"
fig_Throw_Away = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
fig_Throw_Away.write_image(file_Name, format="pdf")
time.sleep(0.1)
# delete the dummy file again
path_Cwd = Path.cwd()
file_2_Del = path_Cwd/file_NamendError exceptions will be ignored (same behavior as the POSIX rm -f command).
file_2_Del.unlink(missing_ok = True)
# ------------------------ end first time ------------------------ #ndError exceptions will be ignored (same behavior as the POSIX rm -f command).
file_2_Del.unlink(missing_ok = True)
# ------------------------ end first time ------------------------ #
# now run your actual code to generate the plot that you like
The idea is to create a dummy plot, wait a bit and after the waiting you can plot your actual figure that you like. Again, no guarantees, but it worked for me some time ago
I am working with plotly but the output image show the watermark: My code:
My output image:
OS: Ubuntu 20.04 Python: 3.10.9 Plotly: 5.16.1