create a bar with different colors representing different categorical data
Show older comments
HI,
I have a list of data with cancer (c) and normal samples (n) sorted to certain order. I want to make a figure to show a colored bar, with red representing the position of cancer samples and green for normal samples on that bar, then I will repeat this for multiple lists to generate a bar for each list. Could anyone let me know how to do this?
My lists looks like:
1. c c c c c c n n c n n c n n n
2. c n c c n c c n n c n c c c n
...
Many thanks!
Jie
Accepted Answer
More Answers (0)
Categories
Find more on Bar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!