Mercurial > hg > octave-lyh
diff scripts/plot/print.m @ 14355:a6a5c5008e39
Print() function requires figure units to be "pixels".
* print.m: Set the figure's units property to "pixels" during while the
graphics toolkit produces the output.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Fri, 10 Feb 2012 18:16:40 -0500 |
parents | ce2b59a6d0e5 |
children | c097c22e9294 |
line wrap: on
line diff
--- a/scripts/plot/print.m +++ b/scripts/plot/print.m @@ -283,21 +283,29 @@ ## Modify properties as specified by options props = []; + drawnow (); + + ## print() requires figure units to be "pixels" + props(1).h = opts.figure; + props(1).name = "units"; + props(1).value = {get(opts.figure, "units")}; + set (opts.figure, "units", "pixels"); + ## graphics toolkit tranlates figure position to eps bbox in points fpos = get (opts.figure, "position"); - props(1).h = opts.figure; - props(1).name = "position"; - props(1).value = {fpos}; + props(2).h = opts.figure; + props(2).name = "position"; + props(2).value = {fpos}; fpos(3:4) = opts.canvas_size; set (opts.figure, "position", fpos); ## Set figure background to none. This is done both for ## consistency with Matlab and to elliminate the visible ## box along the figure's perimeter. - props(2).h = opts.figure; - props(2).name = "color"; - props(2).value{1} = get (props(2).h, props(2).name); - set (props(2).h, props(2).name, "none"); + props(3).h = opts.figure; + props(3).name = "color"; + props(3).value{1} = get (props(3).h, props(3).name); + set (props(3).h, "color", "none"); if (opts.force_solid != 0) h = findall (opts.figure, "-property", "linestyle");