How can I weight the marker size in gscatter?
20 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm using gscatter to plot data by group. I have two vectors of size 100x1 that contain the x and y value, called x and y. I also have a vector of the same size, w, that contains weights. Now, I'd like to weigh the scatter dots by this matrix w. I tried something like
h = gscatter(x,y,gr,linspecer(length(b)-1),'.',30);
h.MarkerSize = w*30;
but it looks like Matlab only accepts a scalar for the marker size.
Thanks for your help.
0 个评论
采纳的回答
Walter Roberson
2016-10-11
编辑:Walter Roberson
2016-10-11
gscatter() creates lines, and lines can only have one marker size per line.
Consider using multiple scatter() calls instead, one per group (because scatter can only handle one marker shape per call)
更多回答(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!