[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: printing figures with development version

From: Ben Abbott
Subject: Re: printing figures with development version
Date: Fri, 27 Mar 2009 14:25:47 -0400

On Friday, March 27, 2009, at 02:12PM, "Ivan Sutoris" <address@hidden> wrote:
>On Fri, Mar 27, 2009 at 6:22 PM, Ben Abbott <address@hidden> wrote:
>> On Friday, March 27, 2009, at 01:08PM, "Ivan Sutoris" <address@hidden> wrote:
>>>when printing figures to eps files with development version of Octave,
>>>results differ from 3.0.3 - it seems as if the whole paper page was
>>>exported, not just the figure itself, so that there are wider margins
>>>around the figure. This is not so visible with default settings where
>>>the figure fills most of the page, but if I try to decrease it's size
>>>with figure's paperposition property, I get small figure somewhere on
>>>the page and lots of empty space around it. I'm attaching output from
>>>both versions for this simple figure:
>>>print strcat('figtest',version,'.eps') -depsc
>>>Is this difference expected or is it a bug (or is something messed up
>>>on my end)?
>>>Ivan Sutoris
>> Hi Ivan,
>> What you see is intended. You'll need to adjust the figure's paper 
>> properties. Specifically, "papersize" and "paperpositon"
>> If you'd like an 6.4in x 4.8in eps file
>> figure (1)
>> clf
>> plot (randn (50, 1))
>> set (gcf, "paperunits", "inches"); # the default is "inches"
>> paper_size = [6.4, 4.8];
>> set (gcf, "papersize", paper_size)
>> set (gcf, "papertype", "<custom>")
>> set (gcf, "paperposition", [0, 0, paper_size])
>> print (gcf, strcat ("figtest", version, ".eps"), "-depsc")
>> This will be much simpler once the all listeners for these properties are in 
>> place.
>> Ben
>Thanks, this works well. However, there is another problem - when I
>change paperunits property from inches to centimeters (being European,
>I prefer the metric system :) in above script, I get a huge figure (I
>mean really huge, about 16 by 12 inches).
>Ivan Sutoris

Much (not all) of the gnuplot backend is written assuming that property 
lisenters are in place. In thie instance it is assumed that the value for the 
papesize/position will be automatically changed when the paperunits are changed.

Thus, the backend temporarily sets the paperunits to "inches", assumes the 
listener handles the conversion, and then sets the paperunits back when print 
command is done. This would  work nicely, except there is not listener in place 

I have an m-file implementation that can handle this, but it should be done at 
a lower level ... and the listener should be activated when the figure is 
created/initialized, which I understand is done in the c++ sources as well. As 
my c++ skills are embarassingly weak I'm not confident I know *where* to do 
this, but am confident I don't know how :-(

... in any event, the short explanation is that you have to use inches at the 


p.s. How are your c++ skills? If you are interested in fixing this, I can 
provide you with the m-file that handles units conversion for all properties as 
well as the handling other details related to the paper properties.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]