www.delorie.com/gnu/docs/plotutils/plotutils_74.html   search  
 
Buy GNU books!


The Plotutils Package

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

C. Page Sizes and Viewport Sizes

When producing output in such formats as Illustrator, Postscript, PCL 5, HP-GL, and Fig, it is important to specify the size of the page on which the output will be printed. The GNU libplot library allows the user to specify a PAGESIZE parameter, which can be used for this. The command-line graphics programs graph, plot, pic2plot, tek2plot, and plotfont, which are built on libplot, support a PAGESIZE environment variable and a `--page-size' option.

Graphics drawn by libplot are nominally drawn within a graphics display, or `viewport'. When producing such raster formats as PNG, PNM, and pseudo-GIF, it will use a square or rectangular bitmap as its viewport. But when producing Illustrator, Postscript, PCL 5, HP-GL, and Fig format, it will use a square or rectangular region on the page as its viewport. Except in the HP-GL case, the viewport will by default be centered on the page. Graphics will not be clipped to the viewport, so the entire page will in principle be imageable.

Either or both of the dimensions of the graphics display can be specified explicitly. For example, the page size could be specified as "letter,xsize=4in", or "a4,xsize=10cm,ysize=15cm". The dimensions of the graphics display are allowed to be negative (a negative dimension results in a reflection). Inches, centimeters, and millimeters are the supported units.

It is also possible to position the graphics display precisely, by specifying the location of its lower left corner relative to the lower left corner of the page. For example, the page size could be specified not merely as "letter" or "a4", but as "letter,xorigin=2in,yorigin=3in", or "a4,xorigin=0.5cm,yorigin=0.5cm". In all cases, the viewport position may be adjusted by specifying an offset vector. For example, the page size could be specified as "letter,yoffset=1.2in", or "a4,xoffset=-5mm,yoffset=2.0cm". The viewport may also be rotated, by setting the ROTATION parameter or environment variable, or (in the case of the graphics programs) by using the `--rotation' option. A rotated viewport does not change the position of its four corners. Rather, the graphics are rotated within it. If the viewport is rectangular rather than square, this `rotation' necessarily includes a rescaling.

Any ISO page size in the range "a0"..."a4" or ANSI page size in the range "a"..."e" may be specified. ("letter" is an alias for "a", which is the default, and "tabloid" is an alias for "b"). "legal", "ledger", and the JIS [Japanese Industrial Standard] size "b5" are recognized also. The following are the supported page sizes and the default square viewport size that corresponds to each.

"a" (or "letter"; 8.5in by 11.0in)
8.0in

"b" (or "tabloid"; 11.0in by 17.0in)
10.0in

"c" (17.0in by 22.0in)
16.0in

"d" (22.0in by 34.0in)
20.0in

"e" (34.0in by 44.0in)
32.0in

"legal" (8.5in by 14.0in)
8.0in

"ledger" (17.0in by 11.0in)
10.0in

"a4" (21.0cm by 29.7cm)
19.81cm

"a3" (29.7cm by 42.0cm)
27.18cm

"a2" (42.0cm by 59.4cm)
39.62cm

"a1" (59.4cm by 84.1cm)
56.90cm

"a0" (84.1cm by 118.9cm)
81.79cm

"b5" (18.2cm by 25.7cm)
16.94cm

SVG format and WebCGM format have no notion of the Web page on which the viewport will ultimately be positioned. They do have a notion of default viewport size, though this will normally be overridden when the output file is placed on a Web page. When producing SVG or WebCGM output, this default viewport size is set by PAGESIZE, or (in the case of the graphics programs) the `--page-size' option. The "xorigin", "yorigin", "xoffset", and "yoffset" specifiers, if included, are ignored.

For a similar reason, the "xorigin" and "yorigin" specifiers are ignored when producing HP-GL or HP-GL/2 output. The lower left corner of the viewport is positioned at the HP-GL `scaling point' P1, whose location is device-dependent. The "xoffset" and "yoffset" specifiers are respected, however, and may be used to reposition the viewport.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)