Show Sidebar Hide Sidebar

Text and Font Styling in Python

How to edit and style the font of graphs in python.

# Learn about API authentication here: https://plot.ly/python/getting-started
# Find your api_key here: https://plot.ly/settings/api

import plotly.plotly as py
import plotly.graph_objs as go

data = [
    go.Scatter(
        x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
        y=[0, 1, 2, 3, 4, 5, 6, 7, 8]
    )
]
layout = go.Layout(
    title='Global Font',
    font=dict(family='Courier New, monospace', size=18, color='#7f7f7f')
)
fig = go.Figure(data=data, layout=layout)
plot_url = py.plot(fig, filename='global-font')
Still need help?
Contact Us

For guaranteed 24 hour response turnarounds, upgrade to a Developer Support Plan.