Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default font in Python Plotly?

Tags:

python

plotly

For instance, for a graph such as this made with basic plotly code enter image description here

What is the font used here?

like image 816
AxW Avatar asked Mar 27 '26 11:03

AxW


1 Answers

The default font family spec is "Open Sans", verdana, arial, sans-serif, as listed in Python Figure Reference: layout from the Plotly documentation. The precise font selected depends on which fonts you have installed on your system. If Open Sans is available, that font will be selected. If you don't have Open Sans, Plotly will try to use Verdana, and in absence of that, Arial. If no font from any of those families is available, Plotly will default to using any sans-serif available on your system.

Based solely on the shape of the lowercase a in the title of the plot you posted, it appears that your plot was rendered using Open Sans.

The relevant passage from the Pyplot documentation is quoted below (emphasis mine).

font

Code: fig.update_layout(font=dict(...))
Type: dict containing one or more of the keys listed below.

Sets the global font. Note that fonts used in traces and other layout components inherit from the global font.

family

Code: fig.update_layout(font_family=<VALUE>)
Type: string
Default: ""Open Sans", verdana, arial, sans-serif"

HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system.

like image 143
Brian Avatar answered Mar 30 '26 02:03

Brian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!