Skip to content

Document simple_white template #169

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions python/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ From this, we can see that the default theme is `"plotly"`, and we can see the n


#### Specifying themes in Plotly Express
All Plotly Express functions accept a `template` argument that can be set to the name of a registered theme (or to a `Template` object as discussed later in this section). Here is an example of using Plotly Express to build and display the same scatter plot with five different themes.
All Plotly Express functions accept a `template` argument that can be set to the name of a registered theme (or to a `Template` object as discussed later in this section). Here is an example of using Plotly Express to build and display the same scatter plot with six different themes.

```python
import plotly.express as px

gapminder = px.data.gapminder()
gapminder_2007 = gapminder.query("year==2007")

for template in ["plotly", "plotly_white", "plotly_dark", "ggplot2", "seaborn", "none"]:
for template in ["plotly", "plotly_white", "plotly_dark", "ggplot2", "seaborn", "simple_white", "none"]:
fig = px.scatter(gapminder_2007,
x="gdpPercap", y="lifeExp", size="pop", color="continent",
log_x=True, size_max=60,
Expand All @@ -69,7 +69,7 @@ for template in ["plotly", "plotly_white", "plotly_dark", "ggplot2", "seaborn",
```

#### Specifying themes in graph object figures
The theme for a particular graph object figure can be specified by setting the `template` property of the figure's `layout` to the name of a registered theme (or to a `Template` object as discussed later in this section). Here is an example of constructing a surface plot and then displaying it with each of five themes.
The theme for a particular graph object figure can be specified by setting the `template` property of the figure's `layout` to the name of a registered theme (or to a `Template` object as discussed later in this section). Here is an example of constructing a surface plot and then displaying it with each of six themes.

```python
import plotly.graph_objects as go
Expand All @@ -85,7 +85,7 @@ fig = go.Figure(
height=500,
))

for template in ["plotly", "plotly_white", "plotly_dark", "ggplot2", "seaborn", "none"]:
for template in ["plotly", "plotly_white", "plotly_dark", "ggplot2", "seaborn", "simple_white", "none"]:
fig.update_layout(template=template, title="Mt Bruno Elevation: '%s' theme" % template)
fig.show()
```
Expand Down