-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom ordinal color schemes #1218
Comments
related: #630 We want to find a way to register schemes; for example maybe something like
would return an instance of Plot that knows about this new scheme. For ordinal color scales you can already specify
but it's not exactly the same as an ordinal scheme. |
You can set the color.range option for a custom ordinal color scheme. Plot.plot({
color: {
range: ["#36a2eb", "#ff6384", "#ff9f40", "#ffcd56", "#4bc0c0", "#9966ff", "#c9cbcf"],
legend: true
},
marks: [
Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", stroke: "species"})
]
}) For ordinal scales, the color.scheme option is merely shorthand for a built-in range; you can always specify the range explicitly yourself if desired. |
Thank you! |
Hi,
I would like to be able to somehow specify a custom color scheme so I can create my charts with our brand colors. As far as I saw from documentation and digging through the source code, there is no way to specify a custom scheme. On can use
interpolate
option, but that works only when there is a range, so not with ordinal scales.My suggestion would be that you check if scheme is an array or function and then threat it as custom color scheme, otherwise it behaves as it does now.
The text was updated successfully, but these errors were encountered: