Skip to content

Commit e2f041a

Browse files
committed
update CHANGELOG
1 parent 24a6532 commit e2f041a

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,27 @@ The new [*sort* options](https://github.com/observablehq/plot/blob/main/README.m
4444
Plot.barY(alphabet, {x: "letter", y: "frequency", sort: {x: "y", reverse: true}})
4545
```
4646

47-
Color scales now support the *threshold* scale type, allowing you to specify a set of *n* - 1 discrete (typically numeric) thresholds to produce *n* discrete colors. The new *quantile* scale type will automatically compute *n* - 1 thresholds for *n* quantiles based on the data.
47+
Color scales now support the *threshold* scale type, allowing you to specify a set of *n* - 1 discrete (typically numeric) thresholds to produce *n* discrete colors.
48+
49+
<img width="640" alt="a histogram showing the forecast probabilities of Democratic electoral votes in the 2016 U.S. presidential election, with outcomes of 270 votes highlighted in blue" src="https://user-images.githubusercontent.com/230541/130157825-0624447b-f39d-4a2a-9363-e18129d6f20e.png">
50+
51+
```js
52+
Plot.plot({
53+
y: {
54+
percent: true
55+
},
56+
color: {
57+
type: "threshold",
58+
domain: [270]
59+
},
60+
marks: [
61+
Plot.ruleX(data, {x: "dem_electoral_votes", y: "probability",stroke: "dem_electoral_votes",strokeWidth: 1.5}),
62+
Plot.ruleX([270])
63+
]
64+
})
65+
```
66+
67+
The new *quantile* color scale type will automatically compute *n* - 1 thresholds for *n* quantiles based on the data.
4868

4969
Diverging color scales now support transformations via four new scale types: *diverging-sqrt*, *diverging-pow*, *diverging-log*, and *diverging-symlog*, corresponding to the *sqrt*, *pow*, *log*, and *symlog* quantitative scale types respectively.
5070

0 commit comments

Comments
 (0)