GenericMappingTools / gmt

The Generic Mapping Tools
https://www.generic-mapping-tools.org
Other
860 stars 359 forks source link

CPT files with labels should optionally apply to the interval #4903

Open PaulWessel opened 3 years ago

PaulWessel commented 3 years ago

Description of the desired feature

This issue derives partly from this post on the forum. Per our documentation, the CPT may have a flag L|U|B to indicate that the optional label should be placed on the lower, upper, or both ends of the color slice. However, if the color slice represents an interval (e.g., a day, year, geologic period) then one would actually want the label to be placed at the center of the slice interval. It would seem the only way to accomplish this is to allow the flag I for Interval. Then, tools like colorbar can know what to do with custom annotations for unequal intervals. The closest thing we have to doing this is colorbar -Li, which does use the label as an interval annotation, but it also turns all color intervals to equal lengths, which is not what we want here. As an example of a slice in such as CPT file:

66.0 lightgreen 72.1 lightgreen I ; Maastrichtian

since that is the name of a geologic interval.

An alternative to the flag would be to instead enhance -L to take to take a modifier to not make the intervals equal size. Thoughts, @GenericMappingTools/core ?

WalterHFSmith commented 3 years ago

Could you extend the options LUB to include LUBC, where C means the label goes at the center? Would it need a text string after it, since it might not be a numerical value?

e.g, 65 r g b 251 r g b C Mesozoic

On Mar 4, 2021, at 5:05 PM, Paul Wessel notifications@github.com wrote:

Description of the desired feature

This issue derives partly from this post on the forum. Per our documentation, the CPT may have a flag L|U|B to indicate that the optional label should be placed on the lower, upper, or both ends of the color slice. However, if the color slice represents an interval (e.g., a day, year, geologic period) then one would actually want the label to be placed at the center of the slice interval. It would seem the only way to accomplish this is to allow the flag I for Interval. Then, tools like colorbar can know what to do with custom annotations for unequal intervals. The closest thing we have to doing this is colorbar -Li, which does use the label as an interval annotation, but it also turns all color intervals to equal lengths, which is not what we want here. As an example of a slice in such as CPT file:

66.0 lightgreen 72.1 lightgreen I ; Maastrichtian

since that is the name of a geologic interval.

An alternative to the flag would be to instead enhance -L to take to take a modifier to not make the intervals equal size. Thoughts, @GenericMappingTools/core ?

— You are receiving this because you are on a team that was mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

PaulWessel commented 3 years ago

It could be C, but elsewhere in GMT we use I for interval (e.g., for custom annotations) so I think I should stick with the same letter. The label is detected via the ; indicator if there is one.