Re: Inser text in graph
- From: "Sanaa " <findingsanaa@xxxxxxxxx>
- Date: Wed, 6 Jun 2012 20:47:07 +0000 (UTC)
Thanks a lot for helping me. I have modified the code according to what Me. Nasser wrote. That is I don't have color_vec anymore, I am having annot instead, that's why I am getting the error
??? Error using ==> set
Color value must be a 3 element numeric vector
Error in ==> Trajectories_modified at 27
for ix=1:3,set(oh(ix*2),'color',annot(ix)),end
The code is
clear all; close all;
r_vec = [0.25, 0.5, 1];
annot = {'r','b','k'};
rho = 0.5;
n = 50;
Nit = 10;
figure(1);
hold on
for j = 1 : length(r_vec)
x_previous = ones(1,n);
x_next = x_previous;
time = linspace(0,r_vec(j),n);
% plot(time,x_next,'.') %why?
for i = 1: Nit
x_next = 1 - rho*x_previous.^2;
x_previous = x_next;
time = linspace(i*r_vec(j),(i+1)*r_vec(j),n);
plot(time,x_next,char(annot(j)),'linewidth',3)
end
end
[lh,oh]=legend({'r=0.25';'r=0.5';'r=1'});
for ix=1:3,set(oh(ix*2),'color',annot(ix)),end
%for ix=1:3,set(oh(ix*2),'color',color_vec(ix)),end
xlabel('t')
ylabel('x')
Thanks a lot in advance.
.
- Follow-Ups:
- Re: Inser text in graph
- From: dpb
- Re: Inser text in graph
- References:
- Inser text in graph
- From: Sanaa
- Re: Inser text in graph
- From: Nasser M. Abbasi
- Re: Inser text in graph
- From: Sanaa
- Re: Inser text in graph
- From: Nasser M. Abbasi
- Re: Inser text in graph
- From: Sanaa
- Re: Inser text in graph
- From: Nasser M. Abbasi
- Re: Inser text in graph
- From: Sanaa
- Re: Inser text in graph
- From: dpb
- Re: Inser text in graph
- From: dpb
- Inser text in graph
- Prev by Date: Re: netcdf problem
- Next by Date: Can someone help me with this problem.
- Previous by thread: Re: Inser text in graph
- Next by thread: Re: Inser text in graph
- Index(es):