makecpt and grd2cpt overwrite explicit +c category labels with +k keys
维护者通常 1 天内回复
评估
调研方向
首先阅读 -F 文档和 src/gmt_support.c 中的共享 helper,尤其是 issue 中提到的 label 和 key 处理。使用提供的 makecpt 命令重现问题,然后检查 grd2cpt 中的相同行为。完成标准是:在两个命令中,+kA 都将查找键设置为 A、B、C,同时显式标签仍为 Wood、Water、Gold。
由索引模型根据 Issue 内容生成。
描述
Description of the problem
When -F+c supplies display labels and +k supplies lookup keys, the keys also replace the display labels. The one-command example from the PR that introduced +k reproduces this with an ASCII palette. Original example
Full script that reproduces the problem
gmt makecpt -Ccategorical -T0/2/1 -F+cWood,Water,Gold+kA
Actual outcome
A green L ;A
B blue L ;B
C red B ;C
N 128
The command exits 0 with empty stderr. Removing +kA writes ;Wood, ;Water and ;Gold. Removing +cWood,Water,Gold writes the keys as default labels, as expected.
Expected outcome
The first three rows should have lookup keys A, B, C and labels ;Wood, ;Water, ;Gold. The -F documentation describes these two fields separately. On master at 51117ebe, the shared helper assigns the labels and then copies each key over its label. Option documentation · Shared helper
grd2cpt shows the same behavior. The following commands produce A and B as the keys and as the labels, despite the explicit Wood and Water labels.
gmt grdmath -R0/2/0/2 -I0.5 X = grid.nc
gmt grd2cpt grid.nc -Cturbo -T0/2/1 -F+cWood,Water+kA
System information
Windows 11 x86-64, GMT 6.7.0, classic mode.
- 主要语言
- C
- 星标
- 999
- 派生
- 421
- 平均合并
- 12 小时 59 分钟
- 30 天内合并 PR
- 58
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GenericMappingTools/gmt 的其他 Issue
-
Add support for SCM 9.0.0 to GMT可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
GenericMappingTools/gmt#9316 · 10 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 62/100
GenericMappingTools/gmt#5767 · 15 条评论 ·
维护者通常 1 天内回复
-
discussion
难度 5/5 一周以上 新手友好度 35/100
GenericMappingTools/gmt#9343 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 45/100
GenericMappingTools/gmt#9331 · 1 个 reaction ·
维护者通常 1 天内回复
-
histogram: the min/max setting in -T is ignored when -R is set可能已有人在做 @seisman 于 2 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 55/100
GenericMappingTools/gmt#9330 · 1 个 reaction ·
维护者通常 1 天内回复
查看 GenericMappingTools/gmt 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 82/100
erkamyaman/rust-anything#1372 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复