Specify the color
See original GitHub issuemv_dict = {'type': ['values', 'values'], 'quantity': [5, 10], 'category': ['mv', 'no_mv']}
df = pd.DataFrame(mv_dict)
alt.Chart(df).mark_bar().encode(
y='type',
x='sum(quantity)',
color='category',
)
With this piece of code, the graph is generated automatically using blue for ‘mv’ and orange for ‘no_mv’
Since in some contexts, the color has an implicit connotation…could it be possible to specify what color I want to use for ‘mv’ (e.g. red) and what for ‘no_mv’ (e.g. green)?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Defining Colors in CSS
There are several different ways to specify colors in CSS. Color Keywords; RGB; RGBA; HSL; HSLA; Hexadecimal. Color Keywords. The first and easiest...
Read more >Specifying Colors — Matplotlib 3.6.2 documentation
Matplotlib recognizes the following formats to specify a color. ... The colors green, cyan, magenta, and yellow do not coincide with X11/CSS4 colors....
Read more >Specify Plot Colors - MATLAB & Simulink - MathWorks
Specify Plot Colors. MATLAB ® creates plots using a default set of colors. The default colors provide a clean and consistent look across...
Read more ><color> - CSS: Cascading Style Sheets - MDN Web Docs
The <color> data type is specified using one of the options listed below. Note: Although <color> values are precisely defined, their actual ...
Read more >Choose colors in Adobe Photoshop
In the Adobe Color Picker, you choose colors using four color models: HSB, RGB, Lab, and CMYK. Use the Adobe Color Picker to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here you go:
You can also use
alt.Color('category', scale=alt.Scale(scheme=scheme_name))
wherescheme_name
is a string that matches any of the available Vega color schemes: https://vega.github.io/vega/docs/schemes/#referenceEdit: scheme should be a scale argument