How to make scatter points into squares of a given size?
39 ビュー (過去 30 日間)
古いコメントを表示
I would like to make a figure where my data points 'c' are squares of a given size instead of points.
The problem with the scatter function is that the points are too small. Making them larger will result in the data points overlaping.
x = (1:121);
y = zeros(1,121);
c = rand(1,121);
scatter(x,y,20,c)
Any help would be appreciated.
Many thanks,
Rob.
0 件のコメント
回答 (1 件)
Walter Roberson
2017 年 12 月 15 日
編集済み: Walter Roberson
2017 年 12 月 15 日
scatter(x, y, c, 'Marker', 's')
Note: Many readers would tend to associate the variable name 'c' with "color", but you are using it in a position associated with marker size.
2 件のコメント
Walter Roberson
2017 年 12 月 15 日
scatter(x, y, [], c, 'Marker', 's')
The order is x, y, size, color, then property/value pairs.
参考
カテゴリ
Help Center および File Exchange で Discrete Data Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!