clf;

t = (0:0.1:9);

x = sin (t);

y = 5 * cos (t);

[hax, h1, h2] = plotyy (t, x, t, y);

set(hax,{'ycolor'},{'blue';'red'})

set(h1, "linestyle", ":");

set(h2, "linestyle", "-");

set(h1,'LineWidth',2);

set(h1,'Color','blue');

set(h2,'LineWidth',2);

set(h2,'Color','red');

xlabel (hax(1), "xlabel");

title (hax(2), 'plotyy demo');

ylabel (hax(1), "Left axis is Blue");

ylabel (hax(2), "Right axis is Red");

--

Sent from:

http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html