Get a plot to automatically load different colors using a matrix
古いコメントを表示
I am trying to plot 16 different sets of data onto 1 plot, and my adviser suggested concatenating the data I am using (amplitude data) and then when plotting it should load all 16 in different colors automatically. I was able to concatenate the data, but for some reason I can't get it to plot correctly. Here is a snippet of my data below:
load(FILENAME);
respidx = find(n1p2amp > THR_CRIT);
allamp = cat(2, n1p2amp,allamp);
plot (masker*ELEC_SPACE,allamp)%plots amplitude data
xlabel('Masker Electrode (re: electrode spacing)')
ylabel ('Amplitude (mV)');
text(masker(respidx(maxidx))*ELEC_SPACE,n1p2amp(respidx(maxidx)),[num2str(maskch)],...
'VerticalAlignment','middle',...
'HorizontalAlignment','right',...
'FontSize',10)
hold on;
set(gca,'XLim',[0*ELEC_SPACE 16*ELEC_SPACE],'YLim',[-0.1 0.6]);
set(gca, 'XTick',0:4*ELEC_SPACE:16*ELEC_SPACE);
This is all contained within the loop "i" which is essentially numbered 1:16. I have a 16x16 matrix for each subject, so the x-axis has 16 points with each point containing 16 data points, if that makes sense. I just don't want to have to manually tell this to do 16 different colors. Thanks!
採用された回答
その他の回答 (1 件)
Image Analyst
2014 年 10 月 2 日
0 投票
The easiest way is to specify the color when you plot. If you don't you get the default colors. Maybe you'd be interested in my ColorOrder demo where you can alter the default colors.

3 件のコメント
Lindsay
2014 年 10 月 2 日
Lindsay
2014 年 10 月 2 日
Image Analyst
2014 年 10 月 2 日
You're welcome. Maybe you could "Vote" for the answer even if it didn't earn your "Acceptance", if it at least you learned something from it.
カテゴリ
ヘルプ センター および File Exchange で Orange についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!