problem with figure size

Michael D. Godfrey godfrey at isl.stanford.edu
Tue Feb 3 18:25:57 CST 2009


After a recent update from current hg repository I found
that figure sizing no longer works correctly for me.
I use:
print("haber_fig16.ps","-solid");

The size of the PS graph is fixed by
    set(gx, "position", [0.13, 0.11, 0.775, 1.14]);
This changes the size, but the bounding box is wrong.
If I use "-debug" and edit the first line which is unconditionally:
set terminal postscript enhanced size 8,6 portrait mono solid
to the size that I intended, then I can recover the size that I got
before the latest changes to gnuplot_drawnow.m

The text in gnuplot_drawnow.m which generates this line has been changed
as the diff below shows.   Something in this change has introduced this 
error:
Below is an excerpt form the diff of
 14178 2009-01-30 16:48 gnuplot_drawnow.m
and
12972 2009-01-16 00:07 gnuplot_drawnow.m
315,322c294,301
<   screensize    = get (0, "screensize")(3:4);
<   t.normalized  = screensize / t.pixels;
<   fig_size = position(3:4) * (t.pixels / t.(units));
<   fig_pos  = position(1:2) * (t.pixels / t.(units));
<   fig_pos(1) = max (min (fig_pos(1), screensize(1)), 10);
<   fig_pos(2) = max (min (fig_pos(2), screensize(2)), 10);
<   fig_size(1) = max (min (fig_size(1), screensize(1)), 10-fig_pos(1));
<   fig_size(2) = max (min (fig_size(2), screensize(2)), 10-fig_pos(2));
---
 >   t.normalized  = get (0, "screensize")(3:4) / t.pixels;
 >   fig_size = possize * (t.pixels / t.(units));
 >   if (prod (fig_size) > 1e8)
 >     warning ("gnuplot_drawnow: figure size is excessive. Reducing to 
1024x768.")
 >     fig_size = [1024, 768];
 >     position = get (h, "position");
 >     set (h, "position", [position(1:2), fig_size], "units", "pixels");
 >   endif
325c304

=======================================================

I hope this information is sufficient.  A few experiments with
print("test.ps","-debug");
will show that the generated gnuplot file is not correct with respect to
the size values in the first line.

Michael Godfrey



More information about the Bug-octave mailing list