How to plot data points in different colors depending on condition?
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!