I run Octave 4.0.0 on Linux. I need some help generating a plot with two axis and a legend indicating which curve is which. The latter however appears offset from the plot and also makes two new axis appear out of nowhere.
clf;
x = 0:0.1:2*pi;
y1 = sin (x);
y2 = exp (x - 1);
[ax, h1, h2] = plotyy (x,y1, x-1,y2, @plot, @semilogy);
xlabel ('X');
ylabel (ax(1), 'Axis 1');
ylabel (ax(2), 'Axis 2');
text (0.5, 0.5, 'Left Axis', ...
'color', [0 0 1], 'horizontalalignment', 'center', 'parent', ax(1));
text (4.5, 80, 'Right Axis', ...
'color', [0 0.5 0], 'horizontalalignment', 'center', 'parent', ax(2));
title ({'plotyy() example'; 'Left axis uses @plot, Right axis uses @semilogy'});
legend ([h1, h2], {'one', 'two'}, 'location', 'northwest');
Would any of you know how to solve this? To me it sounds like a bug.