MATLAB: How to weight the marker size in gscatter

gscatterweights

Hello,
I'm using gscatter to plot data by group. I have two vectors of size 100×1 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.

Best Answer

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)