Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“中国及邻区地质图数据”的图例用colorbar绘制? #477

Closed
core-man opened this issue Jun 27, 2021 · 1 comment
Closed

“中国及邻区地质图数据”的图例用colorbar绘制? #477

core-man opened this issue Jun 27, 2021 · 1 comment
Labels

Comments

@core-man
Copy link
Member

core-man commented Jun 27, 2021

问题描述

最早提出于 #364 (comment):

原脚本里用 pslegend 画矩形的方式画了图例,我尝试直接用 colorbar 画了一下,也可以画,但是加标题和边框没那么方便,还需要调整:

gmt begin colorbar png
gmt coast -R70/150/13/55 -JM8.6i -Baf -Df -> G255 -BWsNe
gmt set MAP_FRAME_PEN 0.3p
gmt colorbar -Cgeoage.cpt -Dx0c/0c+w-5c/0.5c -L0.1 -G0/15
gmt colorbar -Cgeoage.cpt -Dx5c/0c+w-4.667c/0.5c -L0.1 -G16/29
gmt colorbar -Cgeoage.cpt -Dx10c/0c+w-4.667c/0.5c -L0.1 -G30/43
gmt end show

image

我不确定哪种方式更好,感觉原脚本里用了awk之类的有点复杂,而上面的 colorbar 也需要调更多的参数才能得到类似的效果。

当前,geo3al: 中国及邻区地质图数据的实例图采用 legend模块绘制图例,也可以使用colorbar模块绘制。

Ping @xumi1993 @seisman for comments as I never used legend.

@core-man core-man changed the title 中国及邻区地质图数据的图例用colorbar绘制? “中国及邻区地质图数据”的图例用colorbar绘制? Jun 27, 2021
@seisman
Copy link
Member

seisman commented Jun 27, 2021

我现在觉得原始的方式可能是最简单的方式。用 colorbar 可以实现,但是复杂的地方在于:

  1. 原图里有37个矩形块,无法等分为三份,只能分成 13, 12, 12 三份。在使用 colorbar 的时候,colorbar 的长度就得按照比例设置(比如 13c, 12c, 12c),否则会导致每一列的矩形高度不一样,变得很丑
  2. 原图例里的标题和边框,只能通过 basemap 和 text 实现,反而变得不够自动化了

@core-man core-man closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants