[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getframe fails
From: |
Pantxo |
Subject: |
Re: getframe fails |
Date: |
Sat, 6 Oct 2018 02:53:13 -0500 (CDT) |
JuanPi wrote
> Hi all,
>
> The following code
>
> n = 10000;
> for i=1:4
> figure(i)
> plot (randn(n,1), randn(n,1), '.')
> endfor
>
> for i=1:4
> figure(i)
> set (gcf, 'units', 'normalized', 'position', [0 0 0.9 0.9]);
> drawnow
> imwrite (frame2im (getframe (gcf)), sprintf("/tmp/tstfig-%d.png", i));
> endfor
>
> gives
>
> warning: called from
> getframe at line 102 column 11
> warning: opengl_renderer: Error 'invalid value' (1281) occurred
> drawing 'text' object
>
> and the images are empty.
>
> Any work around? Note that I need getframe because printing to file
> takes forever (opengl or gnuplot))
>
> --
> JuanPi Carbajal
> https://goo.gl/ayiJzi
>
> -----
> “An article about computational result is advertising, not
> scholarship. The actual scholarship is the full software environment,
> code and data, that produced the result.”
> - Buckheit and Donoho
Hi,
I tried to set figure "units" back to "pixels" and remove "drawnow" (which
is part of getframe anyway) and it worked, see bellow. Anyway I can
reproduce this bug. Could you file a bug report?
...
for i=1:4
figure(i)
set (gcf, 'units', 'normalized', 'position', [0 0 0.9 0.9], 'units',
'pixels');
imwrite (frame2im (getframe (gcf)), sprintf("/tmp/tstfig-%d.png", i));
endfor
Pantxo
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html