I want to save a figure that I created with plotly. In jupyter notebook, my plot has the right font. But when I save my figure to a pdf file, it changes the font. How can I keep the font?
import plotly.graph_objects as go
import plotly.io as pio
fig = go.Figure()
fig.update_layout(title="As you can see the font changes, how can I keep the font?",
font_family = "Latin Modern Roman")
fig.show()
pio.write_image(fig, "test.pdf")
Figure in jupyter notebook:
But the saved figure looks like this:

