@@ -33,9 +33,43 @@ jupyter:
33
33
thumbnail : null
34
34
---
35
35
36
- # Supported Colors and Fonts
36
+ <!-- #region -->
37
+ # Colors and Fonts
37
38
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..
39
73
40
74
``` python hide_code=true
41
75
import plotly.graph_objects as go
@@ -129,6 +163,8 @@ fig = display_colors_as_shapes(supported_colors)
129
163
fig.show()
130
164
```
131
165
166
+ ## Supported Fonts
167
+
132
168
``` python
133
169
134
170
```
0 commit comments