|
"Thomas " <meinl@iism.uni-karlsruhe.de> wrote in message <h21tjd$rbr$1@fred.mathworks.com>...
> Hi,
>
> I want to plot vertical lines, given the matrix interv_plot (see code below), where the lines are endpoints of an interval. E.g. interv_plot(j,1,k) is the left point of the k-th interval at level j, while interv_plot(j,2,k) is the right endpoint.
>
> Now I found in the web how to generate vertical lines in a plot (don't know if this is optimal), generating imaginary numbers.
>
> What I'd like to have is to autamtically get assigned a different color to every level j, since J also varies, while the different intervals on the same level have the same color.
>
> Any ideas on this?
>
> Thanks
>
> Thomas
>
>
> for j=1:J
> for k=1:K
> p1 = interv_plot(j,1,k); p2 = interv_plot(j,2,k);
> h1 = p1 + t*i; h2 = p2 + t*i;
> plot(h1, 'm-.', 'Linewidth', 1); plot(h2, 'm-.', 'Linewidth', 1);
> end
> end
thomas, try this...it works
%interpolate to get J colors
cols = get(0,'defaultaxescolororder');
cols = cols(mod(0:J-1,length(cols))+1,:)
for j=1:J
for k=1:K
p1 = interv_plot(j,1,k); p2 = interv_plot(j,2,k);
h1 = p1 + t*i; h2 = p2 + t*i;
plot(h1, 'm-.', 'Linewidth', 1, 'color',[cols(j,:)]); plot(h2, 'm-.', 'Linewidth', 1,'color',[cols(j,:)]);
end
end
|