[GRASS-dev] d.out.file now talks to the PostScript driver

Glynn Clements glynn at gclements.plus.com
Wed May 16 14:11:52 EDT 2007


Glynn Clements wrote:

> > .eps format needs the last two BBox numbers swapped to render correctly
> > in gv if GRASS_LANDSCAPE=TRUE. (if landscape is even meaningful for .eps)
> > %%BoundingBox: 0 0 469 675
> > Landscape .ps is fine already.
> 
> So GV interprets it differently depending upon whether the file is PS
> or EPS? (is it using the extension or the EPSF-3.0 in the header?)

> Does the %%Orientation setting affect it? How about the relative sizes
> of the width and height?

> I'll look into it some more as I get time.

Done that; conclusions:

1. Neither the extension nor the header have any effect. EPS is
treated identically to PS.

2. GV interprets "%%Orientation: Landscape" as "rotate the plot" and
"%%Orientation: Portrait" as "don't rotate". The shape of the bounding
box doesn't have any effect.

3. The bounding box was computed incorrectly if GRASS_{WIDTH,HEIGHT}
were used instead of a paper size.

AFAICT, all combinations now work correctly. Things to bear in mind:

1. The bounding box corresponds to the "screen" area. This may be
larger than the area where rendering occurs, e.g. if you have a region
with width>height but a screen with height>width, you will get blank
regions above and below.

2. GRASS_{WIDTH,HEIGHT} refer to the screen dimensions seen by d.*
commands. If you use GRASS_LANDSCAPE=TRUE, the default 640x480 screen
results in a plot 480pt wide and 640pt high on the page.

3. GRASS_LANDSCAPE=TRUE causes the plot to be rotated so that a
"landscape" plot (width>height) fills more of a page (the known paper
sizes all have portrait orientation, i.e. height>width).

If you want a single plot to fill a sheet of paper, you will want
typically want GRASS_LANDSCAPE=TRUE for "landscape" regions
(width>height). If you're creating output for rendering to an image or
embedding within a document, you should probably leave
GRASS_LANDSCAPE=FALSE (or unset) and just set GRASS_{WIDTH,HEIGHT}
appropriately.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list