On Oct 16, 2009, at 6:14 AM, Tatsuro MATSUOKA wrote:
Hello
I have looked at codes of gnuplot_drawnow.m and print.m.
Initialization of __pixels_per_inch__ is executed in print.m
I think that this is a bug.
Tentatively, this bug(?) can be avoided by dummy print once for
octave 3.2 or later.
plot (1:10);print ('dummy.png','-dpng');clf;
x=[0:1];
for i=[0:100]
plot(x,x*i);
filename=sprintf("%02d.png",i);
drawnow('png',filename);
end
close;unlink('dummy.png');
Side effect: An empty plow window is open during print :-(, but it
is no relation for speed
please forgive the bug will be fixed.
Tatsuro
Regards
Tatsuro
Yes, it is a bug.
To be consistent with Matlab the default output size is specified in
inches. When the output is a bitmap, __pixels_per_inch__ is used to do
the units conversion.
A fix is to edit gnuplot_drawnow.m and replace ...
## Convert to inches using the property set by print().
gnuplot_size = gnuplot_size * get (h, "__pixels_per_inch__");
with ...
## Convert to inches using the property set by print().
try
gnuplot_size = gnuplot_size * get (h, "__pixels_per_inch__");
catch
gnuplot_size = gnuplot_size * get (0, "screenpixelsperinch");
end_try_catch
This would produce an output in the same size as seen on the screen.