I am trying to export a vectorized image from plotly, but am wondering why the .svg export does not retain the text font. The idea is to export in .svg, organize some images in Inkscape and then export the complex image as .png, but I'd need the images with the same font as my Overleaf LaTeX document. Here is the code to reproduce the issue:
a = [1, 2, 3, 4, 5, 6]
b = [5, 6, 8, 2, 4, 3]
data = np.column_stack([a, b])
df = pd.DataFrame(data, columns=["A", "B"])
fig = px.scatter(df)
fig.update_layout(
font=dict(family="Computer Modern", size=25),
)
fig.write_image('png.png')
fig.write_image('svg.svg')
from Retaining the font when exporting vectorized images from python `plotly`


No comments:
Post a Comment