How can I plot this figure?
Mostrar comentarios más antiguos
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 comentarios
DGM
el 11 de Abr. de 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
el 11 de Abr. de 2022
Image Analyst
el 11 de Abr. de 2022
Editada: Image Analyst
el 11 de Abr. de 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
el 16 de Abr. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Discrete Data Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


