scatter plot for plotting categorical data
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have a matrix in which the second row randomnly has 0s and 1s. How do I plot them with different colours and in the same scatter plot?
Thanks in Advance
3 件のコメント
ibabinaca
2019 年 2 月 14 日
The fourth argument in scatter has to do with the color of the circle.https://es.mathworks.com/help/matlab/ref/scatter.html?lang=en.
Since y is a matrix with 0 and 1, if you just put y as the fourth argument it's enough.
x =[10 20 30 40 50];
y = [0 1 0 0 1];
scatter(x,y,50,y,'filled')
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!