hgload problem of plotyy figure

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

hgload problem of plotyy figure

Dmitri A. Sergatskov
I am not sure if this is expected behavior or a bug (octave 6.2.1):

Start octave, run the following script:

h1 = figure ()
x = 0:0.1:2*pi;
y1 = sin (x);
y2 = exp (x - 1);
plotyy (x,y1, x-1,y2, @plot, @semilogy);
hgsave(h1, "ftmp.ofig");

restart octave.
No try to load saved figure:

octave:1> h2 = hgload("ftmp.ofig")
error: =: nonconformant arguments (op1 is 1x1, op2 is 2x1)
error: called from
    struct2hdl>createaxes at line 260 column 20
    struct2hdl at line 166 column 12
    struct2hdl at line 206 column 15
    hgload at line 105 column 10

But if I do figure() first it works:

octave:1> figure()
octave:2> h2 = hgload("ftmp.ofig")
h2 = 2

If I use, say,  plot(x,y1) in the original script  then hgload works even as the first command.