colors - Matlab - Using symbols in gscatter -
ok, i'm trying use gscatter plot 8 different points in figure. these 8 points different , want give them different symbols. know gscatter automatically assign them different colors, want able use figure in black , white. have written following code:
lincol = {'k';'k';'k';'k';'k';'k';'k';'k'}; linsym = {'+';'o';'*';'.';'x';'s';'d';'^'}; limits = [-1 1 -1 1]; close = 1:3; figure(i); hold on gscatter(rfootxdistpertrel(:,i),rfootydistpertrel(:,i),lincol,linsym); legend('pert1', 'pert2', 'pert3', 'pert4', 'pert5', 'pert6', 'pert7', 'pert8') hline(0); vline(0); axis(limits); end
according matlab syntax, should able specify color , marker symbol in way (gscatter(x,y,col,sym)). variables used 8 1 vectors, lincol , linsym. however, gives me error:
error using plot color value must 3 or 4 element vector
can help? it's such silly problem have.
luc
it seems have errors in code. syntax gscatter should include @ least 3 parameters : x
, y
, group
. seems group
missing. furthermore definition of color
, sym
may wrong. try col = 'kkkkkkkk';
instead of lincol = {'k';'k';'k';'k';'k';'k';'k';'k'};
. hope helps.
regards.
jonay
Comments
Post a Comment