Skip to content

Instantly share code, notes, and snippets.

@Ddedalus
Created November 4, 2019 13:20
Show Gist options
  • Select an option

  • Save Ddedalus/266f7dfe5713fca47fc498550c705b20 to your computer and use it in GitHub Desktop.

Select an option

Save Ddedalus/266f7dfe5713fca47fc498550c705b20 to your computer and use it in GitHub Desktop.
Plotly modify default layout
import plotly.graph_objects as go
import plotly.io as io
fig = go.Figure()
fig.update_layout(legend=dict(orientation = "h",
xanchor = "center",
x = 0.5),
margin=dict(l=20, r=20, t=20, b=20))
templated_fig = pio.to_templated(fig)
pio.templates['vscode'] = templated_fig.layout.template
pio.templates.default = 'plotly_white+vscode' # combine multiple templates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment