Skip to content

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

Closed

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?

Activity

  1. added
    feature request
    on Sep 23, 2023
  2. self-assigned this
    on Sep 23, 2023
  3. joa-quim commented on Sep 23, 2023

    @joa-quim
    Member

    Yes, agree and prefer the simpler solution that involves no other modifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions