Re: Rescale ncgms without regenerating them?

From: fred (fred AT XXXXXX)
Date: Fri Nov 02 2001 - 17:04:05 MST


Steve,

The easiest way to get what you describe would be
to recreate the desired output using NCL.
If you need to start with NCGMs, then I think
things are not so good.

If you can retain the aspect ratio of your plots, then
you can use the "-viewport" and "-window" options of ctrans
to effect scaling and positioning.

However, if you want to introduce different scaling in the
X and Y directions, then I think you will need to create
your own graphcap. All you need to do for this is to
start with the ps.color.gc ASCII graphcap and change
some numbers on one line. The line in question is:

  . 1 2 5 SPC . 1 2 5 SPC s LF

This specifies a scaling of 0.125 in the X direction and
also 0.125 in the Y direction (which is the appropriate
scaling for the coordinate space being used). Change those
numbers to to whatever you want. For example, changing the
line to:

  . 2 5 0 SPC . 1 2 5 SPC s LF

would produce a plot that is twice as wide as the original
with the same height. To move the plot around on the
page, play with the DEVICE_COORD_xxxx values in the
graphcap. I assume that you know how to generate a
binary graphcap from an ASCII one and tell ctrans how
to use it. If not, let me know.

As far as putting multiple plots on a page, I don't see
how to do this easily. As you mentioned, one might be
tempted to produce PostScript output from ctrans and then
use one of the ps utilities (such as psnup), but this will
not work. The problem is that the PostScript generated
by ctrans does not conform to the PostScript Document
Structuring Conventions (whereas the PostScript generated
by NCL does), and the ps utilities want DSC conforming
input.

Fred

---------------------------------------------
Fred Clare fred@ucar.edu 303-497-1284
Visualization & Enabling Technologies Section
NCAR Scientific Computing Division
---------------------------------------------

> I would like to do the following 2 tasks with ncgm files made by NCAR 4.1.1:
>
> 1) create postscript output at arbritary scale for both x and y dimensions.
> For example, I can plot an ncgm file to a postscript printer
> with a particular graphcap at 4" x 5". Now, without re-making
> the ncgm file, I want to make the postscript output 5"x8".
>
> 2) plot multiple ncgm files to the same postscript page at arbitrary locations
> including overlaying the output.
>
> I assume that I can do this in Adobe Illustrator after making postscript files
> from the ncgms; however, this is time consuming, particularly if I want to
> do this 20 times.
>
> In the old 1980s VAX/VMS/Ray Bovet version of the pre-GKS NCAR
> package, there was a metacode translator called "plot" that could perform
> the functions I list above except that I don't think a postscript driver was
> ever implemented. This was very simple to use, for example to scale two plots
> and overlay them:
>
> $ plot
> device qms # qms laser printer using quic language
> window 0., 10., 0., 10. # dimensions in inches
> read iop020.dat.1
> plot
> save
> read iop020.dat.2
> plot
> exit
>
> And to put 2 plots on a page at arbitrary locations in the lower left and upper right:
>
> $ plot
> device qms # qms laser printer using quic language
> window 0., 5., 0., 5.
> read iop020.dat.1
> plot
> save
> window 5., 10., 5., 10.
> read iop020.dat.2
> plot
> exit
>
> Is there a tool for doing this? Can NCL do this, and easily?
> As an alternative, I have looked around for simple tools to scale
> postscript files - the ps utilities (e.g., psresize, psscale) of Andrew
> Duggan (I think) look promising but don't seem to do the trick easily.
> Is there another simple tool for manipulating ps files?
>
> Thanks, Steve
>
>
> Dr. Stephen C. Piper
> Geosciences Research Division
> Scripps Institution of Oceanography
> La Jolla, CA 92093-0244
>
> tel: (858) 534-4230 ext. 12
> fax: (858) 534-8814
> email: piper@cdrgsun.ucsd.edu
>



This archive was generated by hypermail 2b29 : Sat Nov 03 2001 - 19:21:11 MST