You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automatically select -Lgap layout in colobar if categorical CPT #7830
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:
Not liking this, we usually decide to add -Lgap:
gmt colorbar -Cclasscolor.cpt -Dx4i/4i+w5i+h -L6p -png 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%).
Activity
joa-quim commentedon Sep 23, 2023
Yes, agree and prefer the simpler solution that involves no other modifier.
Default to color bars with gaps for categorical CPTs
Default to color bars with gaps for categorical CPTs (#7831)