Anass February 2016

Different markers in MATLAB plot

I'm using this generated code to plot a psychometric function between two vectors:

smqi=[0 0.504500000000000   0.540500000000000   0.574800000000000   0.459400000000000   0.500800000000000   0.533900000000000   0.401700000000000   0.462100000000000   0.511300000000000   0.291300000000000   0.347300000000000   0.419900000000000   0.491700000000000   0.552400000000000   0.598600000000000   0.392600000000000   0.426000000000000   0.451400000000000   0.334900000000000   0.359500000000000   0.371300000000000   0   0.640800000000000   0.760600000000000   0.847100000000000   0.336200000000000   0.409200000000000   0.463000000000000   0.357600000000000   0.437700000000000   0.504400000000000   0.421200000000000   0.500200000000000   0.579800000000000   0.452700000000000   0.557200000000000   0.592200000000000   0.314800000000000   0.313800000000000   0.344800000000000   0.315500000000000   0.348300000000000   0.355400000000000   0   0.558100000000000   0.636700000000000   0.702900000000000   0.361500000000000   0.427100000000000   0.469100000000000   0.389700000000000   0.457700000000000   0.489800000000000   0.446800000000000   0.528700000000000   0.589200000000000   0.441500000000000   0.475300000000000   0.499600000000000   0.325500000000000   0.360700000000000   0.364200000000000   0.338400000000000   0.368200000000000   0.396200000000000   0   0.702500000000000   0.813100000000000   0.995500000000000   0.370600000000000   0.476800000000000   0.594300000000000   0.355200000000000   0.452000000000000   0.528500000000000   0.484000000000000   0.567400000000000   0.671500000000000   0.454000000000000   0.460700000000000   0.469600000000000   0.299900000000000   0.318300000000000   0.361900000000000   0.264800000000000   0.263000000000000   0.279500000000000];
MOS=[0.240085000000000  0.558541000000000   0.861963000000000   0.935125000000000   0.276903000000000   0.634308000000000   0.838878000000000   0.268853000000000   0.274772000000000   0.72451800000        

Answers


Suever February 2016

The easiest thing to do, would be to reshape your xData and yData variables into [X x 4] and then pass these to plot to create a separate plot object for each group. You can then set markers as desired.

xData = reshape(xData, [], 4);
yData = reshape(yData, [], 4);

p = plot(xData, yData, '.');
set(p, {'Marker'}, {'.'; 'o'; 'x'; '*'})

hold on
plot(fitresult);

Post Status

Asked in February 2016
Viewed 1,147 times
Voted 9
Answered 1 times

Search




Leave an answer