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

Supply -Baf when colorbar plots a stretched CPT #2311

Merged
merged 7 commits into from
Dec 21, 2019
Merged

Conversation

PaulWessel
Copy link
Member

Tools like grdimage may produce a stretched CPT that fits the z-range of a grid exactly. In those cases we cannot let psscale use the CPT levels as annotation and tick intervals but must override via -Baf. This PR does so by adding a comment keyword STRETCHED to such CPTs as they are written and then we watch for that word upon reading. Closes issue #2307.

Tools like grdiimage may produce a stretched CPT taht fits the range of a grid exactly.  In those cases we cannot let psscale use the CPT levels as annotation and tick intervals but must override via -Baf.  This PR does so by adding a keyword STRETCHED to such CPTs as they are written and then we watch for that word upon reading.  CLoses issue #2307.
doc/rst/source/colorbar_common.rst_ Outdated Show resolved Hide resolved
src/gmt_support.c Outdated Show resolved Hide resolved
@seisman
Copy link
Member

seisman commented Dec 21, 2019

It works well, but STRETCHED doens't sound a good keyword. Most CPTs are stretched version of master CPTs, right?

src/gmt_support.c Outdated Show resolved Hide resolved
PaulWessel and others added 3 commits December 20, 2019 18:04
@PaulWessel
Copy link
Member Author

I agree STRETCHED is dumb, will change to something better. But in the end, it is just for internal consumption.

@seisman
Copy link
Member

seisman commented Dec 21, 2019

The annotations are still messy when -C+i is used. Try the script below.

gmt begin map png
gmt grdimage @earth_relief_20m -JH15c -Rg -Baf -BWSen -C+i1000
gmt colorbar
gmt end show

Perhaps we should add -Baf for all automatically generated CPTs.

@PaulWessel
Copy link
Member Author

Hm, I will debug this later -I must now have understood my implementation of the +idx. If so then yes we would have to do it for all stretched CPTS.

@PaulWessel
Copy link
Member Author

Fixed, will commit after tests complete.

@PaulWessel PaulWessel merged commit 2b26e96 into 6.0 Dec 21, 2019
@PaulWessel PaulWessel deleted the cptstretching branch December 21, 2019 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants