I am having big troubles producing quality plots with the default GNU Octave (3.8.1) which comes with Ubuntu 14.04 LTS. I am trying to re-run some existing code (thousands of lines of code) and the code is broken because there are intermediate plots with legends here and there. I know that the code base is legitimate GNU Octave code.
Here is a minimal crashing example:
graphics_toolkit('gnuplot') # I need this for TeX-like labels,
# but I doubt this cause a trouble with legend
R = 2000;
N = R/4;
t = (0:N-1)/R;
figure # plot without legend which works fine
plot(t*1000, sin(2*pi*100*t), 'b')
xlabel('t ms')
ylabel('p_e Pa')
figure # plot with legend which crash
plot(t*1000, sin(2*pi*100*t), 'b; sine wave;')
xlabel('t ms')
ylabel('p_e Pa')
This is the output in GNU Octave:
>> error: invalid value = northeast
>> error: set: invalid value for radio property "location" (value = northeast)
>> error: called from:
>> error: /usr/share/octave/3.8.1/m/plot/appearance/legend.m at line 995, column 11
>> error: /usr/share/octave/3.8.1/m/plot/draw/private/__plt__.m at line 149, column 7
>> error: /usr/share/octave/3.8.1/m/plot/draw/plot.m at line 220, column 10
Steeldriver, you saved my weekend. Thanks a lot! I had the same problem as the bug in
and it was sufficient to remove the package
from the Ubuntu package repository. It seems like the default GNU Octave package is not compatible with all of the Octave-Forge "add-on" packages in the default repository. Are you able to reproduce the bug by installing that package? Maybe this inconsistency should be reported somewhere.
Btw, the output of
was
and the output of
is
I had the same problem and when removing octave-strings caused other errors. So instead, I've used the "try" statement, as follows:
This seems to do the trick.