How can I plot this figure?
古いコメントを表示
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 件のコメント
DGM
2022 年 4 月 11 日
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
2022 年 4 月 11 日
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
2022 年 4 月 16 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Discrete Data Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


