How can I plot this figure?
Show older comments
X=[1,2,3,4,5,6,7,8,9,10]
Y=['d=1','d=3','d=2','d=2','d=3','d=1','d=2','d=2','d=1','d=3']
The outcome will be similar to this figure.

4 Comments
DGM
on 11 Apr 2022
In order to plot some data, you need data. It's not clear that you have any. You have a list of numbers 1-10 and a list of 11 labels (technically, it's only one long conglomeration of labels, because you're concatenating them all into one). It's not enough to just show a picture of an unexplained plot (or part of a plot) and say you want it. Explain what the figure is, what you have, and how they are related.
SM
on 11 Apr 2022
Image Analyst
on 11 Apr 2022
Edited: Image Analyst
on 11 Apr 2022
How are you determining the width of the gray and black strips? Then are you just using repmat() to replicate some row vector vertically to get your vertically striped image?
X=[1,2,3,4,5,6,7,8,9,10]; %days
Y1=[1,0,0,0,1,0,0,0,1,0]; %d=1 (worker 1)
Y2=[0,0,1,1,0,0,1,1,0,0]; %d=2 (worker 2)
Y3=[0,1,0,0,0,1,0,0,0,1]; %d=3 (worker 3)
y2image = uint8(repmat(128*Y2, [15, 1]));
imshow(y2image)
SM
on 16 Apr 2022
Accepted Answer
More Answers (0)
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

