爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7768|回复: 9

[分享资料] grads2.1的出图命令

[复制链接]

新浪微博达人勋

发表于 2016-3-1 21:48:35 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
看到有帖子在提问grads2.1的出图命令gxprint用法,刚刚从网上找了个英文版的介绍,简单翻译了一下,又装了个grads2.1来测试ok,给大家分享一下:
gxprint
Beginning with GrADS version2.1, the gxprint commandwill produce all hardcopy output in both image and vector graphic formats. Theoutput is based on the current contents of the metabuffer, and it works inbatch mode as well as interactive mode. It replaces the print, gxps, gxeps, and printim commands.
Syntax
gxprint filename options                 --------------用法
where:
filename:  The name of the outputfile. If this file exists, it will be replaced.
           If thefilename ends with ".eps", ".ps", ".pdf",".svg", ".png", ".gif", or ".jpg",then GrADS will automatically create the output in the correspondingformat.
options:
           eps ----------- Produceoutput in EPS format
           ps  -----------  Produce output in PSformat
           pdf  -----------  Produce output in PDFformat
           svg -----------  Produceoutput in SVG format
           png ----------- Produceimage output in PNG format
           gif  -----------  Produce image output inGIF format (not available with Cairo)
           jpg  ----------- Produce image output in JPGformat (not available with Cairo)
           black -----------  Useblack background (default is current display setting)
           white -----------  Usewhite background (default is current display setting)
           xNN  -----------  Horizontal image sizein NN pixels (for image output only)
           yNN  ----------- Vertical image sizein NN pixels (for image output only)
           -e NN ----------- Theblank edge around the plot will be NN inches wide (for PS, EPS, andPDF output only)
           -t NN ----------- Colornumber NN is fully transparent
           -b bgImage -----------  Imagefile bgImage is included in the background of the output
           -f fgImage -----------  Imagefile fgImage is included in the foreground of the output
One or more options may be givenin any order.
大概就是如果文件名后缀是以上几种“pdfjpgpng……”,系统会自动识别
参数balck表示黑底,white表示白底,跟以前一样
xNN yNN表示最终的图片像素
重点:
-t NN 不确定,是指设置为NN颜色号的,该颜色可以透明,因为grads默认是黑底的(即0表示黑色),也就是说直接用-t 0可以得到背景透明的图片?我测试的结果就是这样,如果有错误还请懂的高手指正。
-b –f 分别是叠加背景和前景图片
以下是他们的英文例子:
Usage Notes
gxprint workswith GrADS version 2.1+.
bgImage and fgImage must bePNG format, and the file names should not contain any upper case letters.
The GIF and JPG image formats are notsupport by the Cairo library. These options will work only when using the GDlibrary for rendering image output.
The default width of the edge around thePS, EPS, and PDF output files is 0.15625 inches. An edge width smaller than thedefault may result in the plot getting cropped by the printer.
In GrADS version 2.1+, it is alsopossible to achieve color transparency (full or partial) using the set rgb command.
Multi-page output is not yet supportedwith gxprint.
Examples
The following command produces a 1024x768PNG image into file test.png:
gxprint test.png x1024 y768
This command produces a GIF image withtransparent color 0 and a background image mybkg.png. This means that intest.png, the background image mybkg.png will be seen wherever the color 0(background) appeared in the current display.
gxprint test.png -b mybkg.png -t 0

gxprint.docx

16.59 KB, 下载次数: 53, 下载积分: 金钱 -5

附件完全就是上面的内容,可以不用下载

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-3-2 07:57:45 | 显示全部楼层
感谢分享经验,之前还没仔细研究过
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-3-2 08:02:37 | 显示全部楼层
{:eb502:}谢谢分享!!
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2016-12-31 14:55:31 | 显示全部楼层
{:eb502:}{:eb502:}{:eb502:}
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2017-8-4 14:49:55 | 显示全部楼层
更新换代太快,好好学习
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-9-15 13:17:31 | 显示全部楼层
感谢楼主的分享
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-11-15 12:13:01 | 显示全部楼层
2.1版本怎么出黑白图呀
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-8-29 12:00:55 | 显示全部楼层
你好,请问背景图片设置透明以后,province-basemap白化的效果没了,地图边界外的填色又显示出来了,这个怎么处理?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2019-9-9 18:26:52 | 显示全部楼层
楼主可以分享一下grads安装包嘛
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2019-9-10 16:50:55 | 显示全部楼层
下载看看,谢谢楼主分享
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表