Learn how to use Dash Bio for next-gen sequencing & quality control. 🧬Register for the Oct 27 webinar.

Export of static image as png does not preserve the font selected

Hi! I am trying to export a simple bar graph with a font predetermined by me. The font is a google font named Montserrat and it is installed in my computer.

When I export the image as a svg it does preserve the font, but as a png it doesn’t. Here is a sample of the code I am using and of the two exports. I will apreciate very much your help. Thank you!

import plotly.graph_objects as go
animals=['giraffes', 'orangutans', 'monkeys']

fig = go.Figure([go.Bar(x=animals, y=[20, 14, 23])])
fig.update_layout(font = {'family': 'Montserrat', 
                         'size': 13.5, 
                         'color': '#38393a'})

fig.write_image('image_test.png')  

the image in png

the image exported in svg
svg

Again, thanks!