爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7451|回复: 4

[图形美化] 求教新版2.1 grads如何可以加粗等值线的粗细?

[复制链接]

新浪微博达人勋

发表于 2017-8-12 23:38:42 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 ouc129 于 2017-8-13 12:40 编辑

各位高手,我在画图时想要将等值线的粗度调高一些,原先旧版grads自己的命令set cthick 是1-10,最粗为10,但是我还想更粗一下。请问新版有什么办法吗?
我倒是试过将图的虚页调小,这样画出来线确实变相增粗了,可是图片周围留白多了,需要剪裁,图多就很麻烦。
所以有什么好的办法吗?请教。
下图1为cthick设置为10的效果,我想要更粗一些。  图2为虚页设置变小后,等值线变相增粗的效果,但是需要剪裁图片。麻烦一些。
图1
test.png
图2
图片1.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-8-12 23:41:07 | 显示全部楼层
补充一下,图片是新版2.1画的图。输出格式为png。配色为自己定义另外的。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-8-13 09:14:32 | 显示全部楼层
我只能说你没仔细看过set cthick的用法,不知道的人可能还真的就信了你说的······

set cthick

This command sets the thickness for the contour lines.

Synatx

set cthick thickness

The thickness arg must be an integer in the range of 1 to 12 (or 256 for version 2.1 and later)

Usage Notes

When using GrADS version 2.0.2 and earlier, for the X window display and the image output (e.g. PNG), a thickness setting between 1 and 5 will result in contour lines approximately one pixel wide; a thickness between 6 and 11 will result in contour lines two pixels wide, and a thickness of 12 will give contour lines approximately three pixels wide. For the vector graphics output (e.g. PostScript and Encapsulated PostScript) the contour line thickness will increase with each increment in the thickness value.

If using GrADS version 2.1 and later with the Cairo graphics library enabled, then each thickness setting will increment the contour line thickness, for the X window display and all hardcopy output formats.

The default line widths for thickness settings between 1 and 12 are: 0.6, 0.8, 1.0, 1.25, 1.5, 1.75, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0. The units will depend on the surface being drawn to (pixels or points). In GrADS version 2.1 and later, there is a new command, set lwid, that allows the user to define a new line thickness setting if the 12 default widths are unsatisfactory.

The default thickness setting for contour lines is 4. The thickness setting is reset after each clear command, or when a reset or reinit command is issued.

Examples

Note the (2nd example will only work with version 2.1 or later)

set cthick 6

set lwid 13 1.6
set cthick 13
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-8-13 12:36:02 | 显示全部楼层
river 发表于 2017-8-13 09:14
我只能说你没仔细看过set cthick的用法,不知道的人可能还真的就信了你说的······

set cthick

谢谢River大神的回复,确实,这一点我认错,没有去认真读新版grads的手册,对grads的认识还停留在最早的版本。根据你贴出的说明,我已经可以实现等值线的粗细调节。
新版2.1grads确实在画图上有了很大的提升。画图引擎更强大了,画出的图有NCL和matlab的那种感觉。也非常感谢论坛里这么多牛人对grads的改进。让我们用grads的人可以继续坚持下去。
加粗的命令如下,虚线为7.0宽度,实线为原始宽度:
'set lwid 13 7.0'
'set cthick 13'
希望不知道的人不要被我帖子误导哈~
test.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2022-8-1 15:24:21 | 显示全部楼层
学习到了,感谢分享{:eb301:}{:eb301:}
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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