Skip to content

Commit 51dbf60

Browse files
docs
1 parent 0bc7ba5 commit 51dbf60

File tree

4 files changed

+300
-211
lines changed

4 files changed

+300
-211
lines changed

doc/python/cufflinks.md

Lines changed: 0 additions & 166 deletions
This file was deleted.

doc/python/discrete-color.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.2'
9-
jupytext_version: 1.3.1
9+
jupytext_version: 1.4.2
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.6.8
23+
version: 3.7.7
2424
plotly:
2525
description: How to use and configure discrete color sequences, also known as
2626
categorical or qualitative color scales.
@@ -178,6 +178,15 @@ fig = px.bar(df, y="continent", x="pop", color="continent", orientation="h", hov
178178
fig.show()
179179
```
180180

181+
If your data set already contains valid CSS colors which you wish to use directly, you can pass the special value `"identity"` to `color_discrete_map`, in which case the legend is hidden by default, and the color does not appear in the hover label:
182+
183+
```python
184+
import plotly.express as px
185+
186+
fig = px.bar(x=["a","b","c"], y=[1,3,2], color=["red", "goldenrod", "#00D"], color_discrete_map="identity")
187+
fig.show()
188+
```
189+
181190
### Controlling Discrete Color Order
182191

183192
Plotly Express lets you specify an ordering over categorical variables with `category_orders`, which will apply to colors and legends as well as symbols, [axes](/python/axes/) and [facets](/python/facet-plots/). This can be used with either `color_discrete_sequence` or `color_discrete_map`.

0 commit comments

Comments
 (0)