From: Ignazio G on
Hello,
I am successfully showing the values on a graph for one curve,
the thing is I have 2 curves and the plot is a y-y plot:
for the left y axis curve the values are depicted correctly,
for the right axis curve no - the values are depicted according to the left axis ! !

how do i bypass this?
thank you in advance
From: us on
On Aug 3, 11:30 am, "Ignazio G" <igiunt...(a)yahoo.it> wrote:
> Hello,
> I am successfully showing the values on a graph for one curve,
> the thing is I have 2 curves and the plot is a y-y plot:
> for the left y axis curve the values are depicted correctly,
> for the right axis curve no - the values are depicted according to the left axis ! !
>
> how do i bypass this?
> thank you in advance

show CSSM the relevant part of your code...

us
From: Ignazio G on
> show CSSM the relevant part of your code...
>
> us

[AX,H1,H2] = plotyy(A(:,1),A(:,2),A(:,1),A(:,3),'plot');
text(A(:,1),A(:,2)+2,num2str(A(:,2)),'HorizontalAlignment','center')
text(A(:,1),A(:,3),num2str(A(:,3)),'HorizontalAlignment','center')
set(get(AX(1),'Ylabel'),'String','number of years');
set(get(AX(2),'Ylabel'),'String','number of stations');
xlabel('f');

A is this matrix:
A =

0.2000 9.0000 26.0000
0.2500 11.0000 24.0000
0.3000 14.0000 22.0000
0.3500 18.0000 20.0000
0.4000 21.0000 19.0000
0.4500 24.0000 18.0000
0.5000 28.0000 16.0000
0.5500 33.0000 14.0000
0.6000 36.0000 12.0000
0.6500 40.0000 10.0000
0.7000 44.0000 8.0000
0.7500 47.0000 6.0000
0.8000 51.0000 4.0000
0.8500 51.0000 4.0000
0.9000 75.0000 1.0000
From: us on
"Ignazio G" <igiuntoli(a)yahoo.it> wrote in message <i38vc8$e24$1(a)fred.mathworks.com>...
> > show CSSM the relevant part of your code...
> >
> > us
>
> [AX,H1,H2] = plotyy(A(:,1),A(:,2),A(:,1),A(:,3),'plot');
> text(A(:,1),A(:,2)+2,num2str(A(:,2)),'HorizontalAlignment','center')
> text(A(:,1),A(:,3),num2str(A(:,3)),'HorizontalAlignment','center')

one of the solutions

% your code...
text(A(:,1),A(:,3),num2str(A(:,3)),'HorizontalAlignment','center');
% new code...
% - set the parent axis
text(A(:,1),A(:,3),num2str(A(:,3)),'HorizontalAlignment','center','parent',AX(2));

us
From: Ignazio G on
thank you! the 'parent' worked.

>one of the solutions
>
> % your code...
> text(A(:,1),A(:,3),num2str(A(:,3)),'HorizontalAlignment','center');
> % new code...
> % - set the parent axis
> text(A(:,1),A(:,3),num2str(A(:,3)),'HorizontalAlignment','center','parent',AX(2));
>
> us