How to make scatter points into squares of a given size?
47 次查看(过去 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 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!