Skip to content

Automatically select -Lgap layout in colobar if categorical CPT #7830

@PaulWessel

Description

@PaulWessel

Currently, if you plot a color bar with a categorical CPT:

gmt colorbar -Cclasscolor.cpt -Dx4i/4i+w5i+h -png a

you will by default get this:

a

Not liking this, we usually decide to add -Lgap:

gmt colorbar -Cclasscolor.cpt -Dx4i/4i+w5i+h -L6p -png b

b

But, since categories are never continuous we should automatically detect that and behave as if -L was set. Changing this would be a "bug fix" in the sense we cannot secure backward compatibility. Alternatively, we invent a modifier +c for -L that means "If CPT is categorical, auto-apply -L, else ignore it". For out one-liner plots we would certainly then add -L+c to the internal call. Also if gap is not set we should have a default, e.g., The n-1 gaps should add to 15% of the bar width (for example, here it is ~15%).

Comments?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions