How to plot data points in different colors depending on condition?
Ältere Kommentare anzeigen
Hello,
I've plotted data points accross 320 trials. Within each trial, there were 2 conditions (for example trials 1-80 were random, and trials 81-160 were sequenced, and so on).
I was able to plot the 320 trials, but I would like to specify which condition each data point was by making them different colors.
How can I go about adding this to my plot? I have a separate string called SRTT.Sequence (320x1) which contains all the conditions per trial if that helps.
f1=figure;
x=1:320;
y=SRTT.RT(1:320);
plot(x,y,'-o')
ylabel('Reaction Time (s)');
xlabel('Trial');
set(gca, 'fontsize' , 16, 'fontweight', 'bold');
set(gca,'XTick',(0:20:320));
Thanks in advance for any suggestions.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Scatter Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!