English 中文(简体)
Overlaying or merging multiple .ps files
原标题:

I have used gmt to create several .ps files of x - y graphs with identical axes. I have several sets of data, each containing between 14 and 20 plots. Each plot is in a separate directory.

I would like to overlay every .ps within a dataset, in order to show correlation between the plots.

I know this is similar to the thread posted here:

overlay one pdf or ps file on top of another

but I don t have to deal with multiple pages.

I m not a programmer, I m a student! I would really appreciate a quick-ish way to stack them on top of each other to see an overall trend.

If not, I m off to buy a stack of OHP films and find the nearest photocopier.... which would not look nearly as shiny.

All help is appreciated!

最佳回答

I ve done something like this before, using GMT to produce two plots (of opposite sides of the Earth) to PS and overlaying them, one flipped 180 degrees and reflected (that is, depicting the Earth as a projective plane with each point equated with its antipode).

This was my code:

#!/bin/sh

GMT gmtset BASEMAP_FRAME_RGB +192/192/192
GMT gmtset BASEMAP_FRAME_RGB 0/0/0
GMT pscoast -JS-60/0/16 -R0/360/-90/90 -Di -A5000 -N1 -W -GP300/15:FLightRedB- -SWhite -P -K > mapa.ps
GMT pscoast -JS120/0/16 -R0/360/-90/90 -Bg30/g15 -Di -A5000 -N1 -W -GP300/15:FLightGreenB- -Sp1/50:F-B- -P -O > mapb.ps
sed -i  s/595 842/600 600/g  mapa.ps
sed -i  s/PSL/180 rotate -1 1 scale 0 -1890 translate 
PSL/  mapb.ps
cat mapa.ps mapb.ps > mapc.ps
ps2pdf mapc.ps

Commenting out the second sed line overlays them without flipping the second one. You can probably achieve what you want by tweaking this script and replacing the GMT commands with whatever you re using. The -O option used for the second plot sets overlay mode, which omits the PS code that triggers the creation of a new page. Then you can just cat them together.

问题回答

Well, the Inkscape website says it can import PostScript. take that with a grain of salt, though- I haven t tried it myself.

Alternately, if you don t mind getting your hands a little dirty, PostScript is a fairly human-readable stack based programming language- I highly recommend A First Guide To PostScript. If you can figure out what chunk of the documents contains the plot you want, you ought to be able to copy and paste those together. This all depends heavily upon the quality and organization of code generated by GMT.

Your best bet is probably a vector graphics application like Inkscape (above) or Adobe Illustrator.





相关问题
LaTeX font in Postscript document

I am starting off with Postscript, and would like to do something very simple: include a LaTeX symbol within my Postscript document. For example: %! /FontSize 12 def newpath 0 0 moveto ("Hello ...

Weird problem, with ghostscript and pdf files

am using ghostscript to create pdf file from postscript file. My PS file, doesn t have orientation instructions, so when I want to create landscape pdf file, I m using ghostscript to rotate the page. ...

Convert from PDF to Postscript using Java

I am having a J2EE based application, where I am using a reporting tool to generate outputs in PDF format. I need a utility/ tool in Java which can help me convert my PDF file to postscript format so ...

Overlaying or merging multiple .ps files

I have used gmt to create several .ps files of x - y graphs with identical axes. I have several sets of data, each containing between 14 and 20 plots. Each plot is in a separate directory. I would ...

Postscript number of copies

Is there a way to edit a postscript file, to add or increase the number of copies to be printed?

Convert TIFF to PostScript

I m writing .net code (Windows Forms Application) which reads a TIFF image (CMYK) and sends it to printer (using WritePrinter). Before I send it, I need to convert the TIFF image to PostScript. Could ...

Problem - Sending postscript data to printer using ExtEscape

I m trying to send postscript data to the printer using ExtEscape, but the printer didn t respond at all for the following code (1st ExtEscape returned true. 2nd ExtEscape also returned true, but no ...

Generating Postscript using PHP: browser offers to save file

$ps = ps_new(); ps_open_file($ps,$filename); ps_begin_page($ps,$size,$size); ps_set_parameter($ps, SearchPath , /usr/share/texmf-texlive/fonts/afm/bluesky/cm ); $psfont = ps_findfont($ps, "cmr10", "...

热门标签