"Farid Medleg" <farid.medleg@gmail.com> wrote in message <hrcqus$6o0$1@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
|