- Notifications
You must be signed in to change notification settings - Fork1
Theming chapter#28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
3894c44
46f0d51
85e24bc
388b59a
47e7ba5
7151708
81c774b
f6a6ce6
dd02b24
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -125,7 +125,7 @@ Here is an example that creates a template that sets the default title font to s | ||
import plotly.graph_objects as go | ||
large_rockwell_template = go.layout.Template( | ||
layout=go.Layout(title_font=dict(family="Rockwell", size=24)) | ||
) | ||
fig = go.Figure() | ||
@@ -134,6 +134,8 @@ fig.update_layout(title="Figure Title", | ||
fig.show() | ||
``` | ||
> Note: this example uses magic underscore notation to write `go.Layout(title=dict(font=dict(...)))` as `go.Layout(title_font=dict(...))` | ||
### The template data property | ||
The `data` property of a template is used to customize the default values of the properties of traces that are added to a figure that the template is applied to. This `data` property holds a graph object, with type `go.layout.template.Data`, that has a property named after each supported trace type. These trace type properties are then assigned lists or tuples of graph object traces of the corresponding type. | ||
@@ -297,6 +299,8 @@ fig.update_layout(template="draft") | ||
fig.show() | ||
``` | ||
> Note: this example uses magic underscore notation to write `go.layout.Template(layout=dict(annotations=[...]))` as ``go.layout.Template(layout_annotations=[...])` | ||
It is also possible to set your own custom template as the default so that you do not need to pass it by name when constructing graph object figures or calling plotly express functions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Github's syntax highlighting is confused about this block... does it render OK in Jupyter? | ||
```python | ||