From: Farid Medleg on 29 Apr 2010 16:42 I've got 8 1x2 vectors that I would like to plot. The first value in each vector belongs to the 'x90' category and the second value belongs to the 'xnovib' category. I'd like the x-axis to have two "values".... namely 'x90' and and 'xnovib'. The y-axis will be scaled to the numerical inputs in each of the 8 vectors. How can I plot this with a line joining the two points from each vector considering that the y-axis is numerical and the x-axis is a string. Thanks in advance Farid
From: us on 29 Apr 2010 17:15 "Farid Medleg" <farid.medleg(a)gmail.com> wrote in message <hrcqus$6o0$1(a)fred.mathworks.com>... > I've got 8 1x2 vectors that I would like to plot. The first value in each vector belongs to the 'x90' category and the second value belongs to the 'xnovib' category. > > I'd like the x-axis to have two "values".... namely 'x90' and and 'xnovib'. The y-axis will be scaled to the numerical inputs in each of the 8 vectors. How can I plot this with a line joining the two points from each vector considering that the y-axis is numerical and the x-axis is a string. > > Thanks in advance > Farid one of the many solutions y=[ 1 2 2 4 1.5 4.4 3 2.1 ]; x=repmat(1:2,size(y,1),1); cla; line(x.',y.',... 'linewidth',2,... 'color',[0,1,0]); set(gca,... 'xlim',[0,3],... 'xtick',1:2,... 'xticklabel',{'A','zzz'},... % <- your categories... 'ylim',[0,5]); us
|
Pages: 1 Prev: Statistics? Next: SOLVE 4 NONLINEAR EQUATIONS (HELP PLEASE) |