Hi there,
I have 12 datasets and I want to be able to plot them in three different colour groups (1 to 5, 6 to 10 and 11 to 12) against the same x axis. Here is what I have (below). As you can see, all lines are different colours which doesn't match my legend.
Thanks in advance.
psd = STBcum_hstconc_dia;x = psd(:,1); y1 = psd(:,3); y2 = psd(:,5); y3 = psd(:,6); y4 = psd(:,7); y5 = psd(:,8); y6 = psd(:,9); y7 = psd(:,10); y8 = psd(:,11); y9 = psd(:,12); y10 = psd(:,13); y11 = psd(:,14); y12 = psd(:,15);figure(1)hold onplot(log10(x), y1,log10(x), y2,log10(x), y3,log10(x), y4,log10(x), y5,log10(x), y6,log10(x), y7,log10(x), y8,log10(x), y9,log10(x), y10,log10(x), y11,log10(x), y12, 'linewidth', 1) % Bar of ‘hst_irl’ on log10 of ‘dia_irl’
hold offgridlogxts = [0:2 log10(300.1)]; set(gca,'XTick', logxts) expxts = 10.^(logxts); set(gca, 'XTickLabel', floor(1*expxts)/1) axis([min(logxts) max(logxts) 0 350])ylim autolegend ('show','0-3m','4-7.5m','8.5-10m')
Best Answer