爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5727|回复: 7

[图形美化] 如何用不同的颜色画出省界、河流?效果如图

[复制链接]

新浪微博达人勋

发表于 2017-12-30 11:29:11 | 显示全部楼层 |阅读模式

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

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

x
截图20171230105751.png

最终想达到这样的效果,不知如何实现呢?

在论坛里搜了好多,有说画河流时需要单独draw shp文件的,但是我的grads(家园整合版)报错提示说“unable to open shp”;

set mpdset cnhimap
set mpdset cnriver两个语句会覆盖,不能同时显示;

set mpdset cnriver cnhimap 则不能单独使河流加粗、使省界变细。。。

求助大家~~

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

新浪微博达人勋

发表于 2017-12-30 13:23:59 | 显示全部楼层
试试这个命令。基本可以达到你的要求

colormap

colormap


set mpt

This command to refine the appearance of the map lines.

Syntax

set mpt type off
... or ...
set mpt type color <style <thickness>>

The type is the map type; it can be a number from 0 to 255, or it can be an asterick(*) to indicate this command applies to all the type values.

The color argument may be one of the 16 GrADS default colors, a new color defined with set rgb, or it can be set to -1, in which case GrADS will use the set map settings for this map type.

Options for style are:
     1 - solid
     2 - long dash
     3 - short dash
     4 - long dash, short dash
     5 - dotted
     6 - dot dash
     7 - dot dot dash

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

Usage Notes

The lowres map data set has only one option for type:
1 -- coastlines

For the mres and hires data sets, there are three options for type:
0 -- coastlines
1 -- political boundaries (sorry, in some places these are out of date)
2 -- US state boundaries

Other map files may have more type options.

Changes to the map characteristics 'stick' until reset by a new execution of set mpt, or when a reset or reinit command is issued.

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 map lines approximately one pixel wide; a thickness between 6 and 11 will result in map lines two pixels wide, and a thickness of 12 will give map lines approximately three pixels wide. For the vector graphics output (e.g. PostScript and Encapsulated PostScript) the map 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 map 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 (pixels or points) will depend on the surface being drawn to. 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.

Examples

Suppose you are using the hires data set.
This will result in a map with coastlines and political boundaries, but no US state boundaries:

set mpt 2 off

These will plot the coastlines and political boundaries with thick light gray solid lines, and US state boundaries with thinner white dashed lines:

set mpt 0 15 1 6
set mpt 1 15 1 6
set mpt 2  1 3 3


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

新浪微博达人勋

 楼主| 发表于 2017-12-30 14:50:59 | 显示全部楼层
river 发表于 2017-12-30 13:23
试试这个命令。基本可以达到你的要求

谢谢! 不过还是想问一下 cnworld 和 cnriver应该怎么配合使用呢??相应的set mpt应该怎么设置?我刚自己试了下,还不是很理解
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-12-30 15:11:34 | 显示全部楼层
river 发表于 2017-12-30 13:23
试试这个命令。基本可以达到你的要求

厉害,这个设置很细致的啊
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-12-30 15:14:27 | 显示全部楼层
rabin_xu 发表于 2017-12-30 15:11
厉害,这个设置很细致的啊

请问大概是应该怎么用呢?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-12-30 15:19:22 | 显示全部楼层
river 发表于 2017-12-30 13:23
试试这个命令。基本可以达到你的要求

我刚才想了一个办法,比较不太方便 :


set mpdset cnhimap
set map 15 1 1
d rain

set mpdset cnriver
set map 3 1 5
draw map
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-12-30 21:51:40 | 显示全部楼层
风叶ele 发表于 2017-12-30 15:19
我刚才想了一个办法,比较不太方便 :

可以的,基本是一个意思。就是set mpt 可以控制的东西更多一点,多了海岸线,行政边界和美国边界。你看那个命令的解释就知道了。你仔细看过了就会用了······咱们用的软件大部分都是国外的,你自己不去仔细看英文版的文档,总等着别人翻译给你,那你永远用不上新东西,永远都是在提问题······
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-3-11 12:04:38 | 显示全部楼层
来学习啊啊啊
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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