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

Enable non-contiguous enumerations #506

Open
joffreypeters opened this issue Feb 16, 2023 · 1 comment
Open

Enable non-contiguous enumerations #506

joffreypeters opened this issue Feb 16, 2023 · 1 comment

Comments

@joffreypeters
Copy link
Contributor

Description
The current enumeration legend styling assumes a contiguous enumeration from min to max of the enumeration values. There are datasets with non-contiguous enumerations which end up with "dead space" values in their legends from this choice.

Describe the solution you'd like

Change the enumeration legend in core/style to generate a list of enumeration values rather than creating a range from min to max.

Additional context
Here's a non-contiguous USCS soils legend, showing a bunch of "black" values in the non-contiguous region:

image

@mpu-creare
Copy link
Contributor

mpu-creare commented Feb 16, 2023

Looks like matplotlib's ListedColormap does not support this directly.

You might be able to to this with a custom Norm, something like this: https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.BoundaryNorm.html#matplotlib.colors.BoundaryNorm -- https://stackoverflow.com/questions/9707676/defining-a-discrete-colormap-for-imshow-in-matplotlib

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

No branches or pull requests

2 participants