Skip to content

Commit d886b2f

Browse files
using swatches_cyclical in docs
1 parent 8272258 commit d886b2f

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

Diff for: doc/python/builtin-colorscales.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: "1.2"
8+
format_version: '1.2'
99
jupytext_version: 1.3.1
1010
kernelspec:
1111
display_name: Python 3
@@ -22,8 +22,7 @@ jupyter:
2222
pygments_lexer: ipython3
2323
version: 3.6.8
2424
plotly:
25-
description:
26-
A reference for the built-in named continuous (sequential, diverging
25+
description: A reference for the built-in named continuous (sequential, diverging
2726
and cylclical) color scales in Plotly.
2827
display_as: file_settings
2928
has_thumbnail: true
@@ -103,7 +102,7 @@ Here are all the built-in scales in the `plotly.colors.diverging` module:
103102
```python
104103
import plotly.express as px
105104

106-
fig = px.colors.diverging.swatches()
105+
fig = px.colors.diverging.swatches().update_layout(margin_b=10)
107106
fig.show()
108107
```
109108

@@ -119,6 +118,17 @@ Here are all the built-in scales in the `plotly.colors.cyclical` module:
119118
```python
120119
import plotly.express as px
121120

121+
fig = px.colors.cyclical.swatches_cyclical()
122+
fig.show()
123+
122124
fig = px.colors.cyclical.swatches()
123125
fig.show()
124126
```
127+
128+
```python
129+
130+
```
131+
132+
```python
133+
xx
134+
```

Diff for: packages/python/plotly/_plotly_utils/colors/_swatches.py

+1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ def _swatches(module_names, module_contents, template=None):
4444
xaxis=dict(range=[-0.02, 1.02], showticklabels=False, showgrid=False),
4545
height=max(600, 40 * len(sequences)),
4646
template=args["template"],
47+
margin=dict(b=10),
4748
),
4849
)

Diff for: packages/python/plotly/_plotly_utils/colors/cyclical.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def swatches_cyclical(template=None):
3636

3737
rows = 2
3838
cols = 4
39-
scales = ["IceFire", "Twilight", "Edge", "Phase", "HSV", "mrybm", "mygbm"]
39+
scales = ["Twilight", "IceFire", "Edge", "Phase", "HSV", "mrybm", "mygbm"]
4040
fig = make_subplots(
4141
rows=rows,
4242
cols=cols,

0 commit comments

Comments
 (0)