> HOWTO Rotate a PS file

HOWTO Rotate a PS file

The simplest way is to edit the PS file by hand.

Firstly you need to add a the command

90 rotate
to the PS file. Or whatever angle you require.

Next, you need to adjust the bounding box. If the bounding box is

%%BoundingBox:  Lx Ly Ux Uy
Then for a 90 degree (anti-clockwise) rotation:
(Lx,Ly) -> (-Uy,Lx)
(Ux,Uy) -> (-Ly,Ux)
Eg for
%%BoundingBox:  62 18 729 593
the bounding box becomes
%%BoundingBox:  -593 62 -18 729

Finally, ensure that the first line has an EPSF comment. eg looks like:

%!PS-Adobe-1.0 EPSF-1.2

epsrotate

I've written a small perl script that will rotate encapsulated ps files.:
/home/dan/bin/epsrotate

Usage:

epsrotate infile.eps > outfile.eps
if you have a ps file, convert it to eps first, by using /opt/local/bin/ps2epsi

NOTE

There is a bug in gksm2ps Mod 1.06 which means that landscape plots produced from Ferret metafile have Ux and Uy swapped around.
-Dan
Page updated on