Created
November 4, 2019 13:20
-
-
Save Ddedalus/266f7dfe5713fca47fc498550c705b20 to your computer and use it in GitHub Desktop.
Plotly modify default layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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