I am trying to edit the font title of my graph in Plotly. I’ve read this article on how to change the title font: https://plot.ly/python/font/ but I can’t manage to make it work with the font I want (Franklin Gothic) which is installed on my computer. I don’t have any error but my title is written with the default font.
Is there a way to find all the available fonts in Plotly? And is it possible to add new custom fonts?
I am working with plotly 3.3.0 on jupyter notebook.
Thanks for your help!
Hi @julied20, The font you set in your code is displayed only if it’s installed on your computer.
I ran this code:
import plotly.graph_objs as go
data = [
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
y=[0, 1, 2, 3, 4, 5, 6, 7, 8]
layout = go.Layout(width=500, height=300,
title='Franklin Gothic Font',
font=dict(family="Franklin Gothic", size=18)
fig = go.FigureWidget(data=data, layout=layout)
and here is the plot:
It seems to be Franklin Gothic. Hence it is installed on my system.
I’m encountering the same problem. I have the custom font I want installed on my server on EC2, but figures fail to render the custom font.
The custom font renders correctly on my local machine but not on the server. Is there a way to check what fonts are available to plotly? And where it tried to load them from?
Hey empet, do you know a way of setting the font only for the title? (without affecting the axes)
Yes, I know:
import plotly.graph_objects as go
import numpy as np
title=dict(text="This is my title",
Were you able to solve this problem? I am also having trouble finding which fonts are actually available and how to support custom fonts (*.ttf e.g.)
I’m sorry, but I don’t know such a “secret”. Maybe someone skilled in web programming could give you an advice.