Skip to content

Commit 843e017

Browse files
committed
Update colors-fonts.md
1 parent 0700bc6 commit 843e017

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

doc/python/colors-fonts.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,43 @@ jupyter:
3333
thumbnail: null
3434
---
3535

36-
# Supported Colors and Fonts
36+
<!-- #region -->
37+
# Colors and Fonts
3738

38-
The following are supported colors in Plotly.
39+
40+
## Supported CSS Colors
41+
42+
Named CSS colors are supported
43+
<!-- #endregion -->
44+
45+
```python
46+
import plotly.graph_objects as go
47+
48+
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
49+
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
50+
51+
fig = go.Figure()
52+
fig.add_trace(go.Bar(
53+
x=months,
54+
y=[20, 14, 25, 16, 18, 22, 19, 15, 12, 16, 14, 17],
55+
name='Primary Product',
56+
marker_color='indianred'
57+
))
58+
fig.add_trace(go.Bar(
59+
x=months,
60+
y=[19, 14, 22, 14, 16, 19, 15, 14, 10, 12, 12, 16],
61+
name='Secondary Product',
62+
marker_color='lightsalmon'
63+
))
64+
65+
# Here we modify the tickangle of the xaxis, resulting in rotated labels.
66+
fig.update_layout(barmode='group', xaxis_tickangle=-45)
67+
fig.show()
68+
```
69+
70+
The following named CSS colors are supported in Plotly.py
71+
72+
and can be used anywhere a color property accepts a named CSS color. For example, a color property on font..
3973

4074
```python hide_code=true
4175
import plotly.graph_objects as go
@@ -129,6 +163,8 @@ fig = display_colors_as_shapes(supported_colors)
129163
fig.show()
130164
```
131165

166+
## Supported Fonts
167+
132168
```python
133169

134170
```

0 commit comments

Comments
 (0)