How can I plot this figure?
Mostra commenti meno recenti
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 Commenti
DGM
il 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
il 11 Apr 2022
Image Analyst
il 11 Apr 2022
Modificato: Image Analyst
il 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
il 16 Apr 2022
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Discrete Data Plots in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


