printing figures with development version

Ben Abbott bpabbott at mac.com
Sat Mar 28 14:48:45 CDT 2009


On Mar 28, 2009, at 1:38 PM, Ben Abbott wrote:

>
> On Mar 28, 2009, at 12:17 PM, John W. Eaton wrote:
>
>> On 27-Mar-2009, Ben Abbott wrote:
>>
>> | 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.
>>
>> If I print to a .eps file, I expect that the bounding box of the
>> figure will be fairly tight around the figure so that it may be
>> included directly in another document without a lot of extra
>> whitespace surrounding it.  I think that is most useful.  I also  
>> don't
>> expect to have to fiddle with paper properties to make that happen
>> (how would I know that 6.4x4.8 inches are good values?).
>>
>> Earlier versions of Octave did not add extra whitespace around the
>> figure, so I think we will see a lot of complaints about this change
>> if it escapes into a stable version.
>>
>> What is the motivation for the change?  Is there something good about
>> this design choice that I'm missing?  If the change is purely for
>> Matlab compatibility, then I think this is one of those things that  
>> we
>> should not copy.
>>
>> jwe
>
> The current implementation produces compatible behavior ... except  
> that the BoundingBox defined by gnuplot is not tight, and the one  
> produced by Matlab is.
>
> The current implementation may be modified to obtain the desired  
> BoundingBox result by changing the papersize for the eps output to ...
>
> 	papersize = paperposition + [50, 50, 100, 100]/72;
>
> Where the paperunits are implied to be "inches". The 50pt border is  
> a gnuplot feature.
>
> I'll prepare a changeset.
>
> Ben

I didn't get the description correct above. The attached changeset  
produces an eps-file with what I understand to be the proper bounding  
box.

Shall I push it?

Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeset-epsfile.patch
Type: application/octet-stream
Size: 2894 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20090328/16ade5ba/attachment.obj 
-------------- next part --------------






More information about the Octave-maintainers mailing list