Using multiple columns to define "color"
See original GitHub issueLet’s say I have a dataframe with an x, y, and two categories:
df = pd.DataFrame(dict(
x=[1,2,3],
cat1=['red', 'red', 'blue'],
cat2=['apple', 'apple', 'banana'],
y=[10,11,12]
))
I’d like a plot with 2 lines: “red,apple” and “blue,banana”, with “red,apple” having two points, and “blue,banana” having 1.
I can do this by combining the two columns into one in the dataframe, but this seems like a very common use case that should be natively supported.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Example – Multiple Fields on Color - Tableau Help
Follow these steps, using the Sample - Superstore data source, to build a treemap with two fields on Color. Drag Category and Sub-Category...
Read more >Set background colors for the cells of multiple columns based ...
For columns res1 and res2 , let's say if value content are true s, I'll need to highlight that cell with red background...
Read more >'Use value as color' option for View column affects multiple ...
This is working as designed. When a column color is set using the "Use value as color" property, the color applies to all...
Read more >How to define colors for multiple columns/rings in a JavaScript ...
I know how to use the Color Manager Node to define the colors of one column/ring, but then all other columns are colored...
Read more >Conditional formatting multiple columns by text value
Objective: Change background color using a HEX color code based on cell value for columns PBar_01 to PBar_14. My current solution involves ...
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
How can I encode color with a column that specifies the color? I have this column and what to every bar to use this color instead of the auto one.
You can do this with a Calculate Transform; for example: