覆盖或合并多个.ps文件 [英] Overlaying or merging multiple .ps files

查看:212
本文介绍了覆盖或合并多个.ps文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用gmt创建具有相同轴的x-y图的多个.ps文件.我有几组数据,每组包含14到20个图.每个图都在单独的目录中.

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.

我想覆盖数据集中的每个.ps,以显示各图之间的相关性.

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:

将一个pdf或ps文件覆盖在另一个

但是我不必处理多个页面.

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.

如果没有,我要去买一叠OHP胶片,然后找到最近的复印机....看起来不会那么有光泽.

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

感谢所有帮助!

推荐答案

我之前已经做过类似的事情,使用GMT生成了PS的两个图(位于地球的相对侧)并将其叠加,其中一个图翻转了180度并进行反射(即,将地球描述为一个投影平面,每个点都等于其对映体).

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).

这是我的代码:

#!/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 \nPSL/' mapb.ps
cat mapa.ps mapb.ps > mapc.ps
ps2pdf mapc.ps

注释第二条sed行会覆盖它们,而不会翻转第二条.您可以通过调整此脚本并将GMT命令替换为使用的任何内容来实现所需的功能.用于第二个绘图集的叠加模式的-O选项忽略了触发创建新页面的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.

这篇关于覆盖或合并多个.ps文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆