Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

"Qualitative" colormaps represented as continuous #881

Closed
endolith opened this Issue · 5 comments

2 participants

@endolith

I'm learning about all the colormaps to update the documentation. and it seems some were copied from ColorBrewer and converted into continuous smoothly-varying maps. But ColorBrewer has 3 types of schemes:

  1. Sequential palettes are suited to ordered data that progress from low to high. Lightness steps dominate the look of these schemes, with light colors for low data values to dark colors for high data values.
  2. Diverging palettes put equal emphasis on mid-range critical values and extremes at both ends of the data range. The critical class or break in the middle of the legend is emphasized with light colors and low and high extremes are emphasized with dark colors that have contrasting hues.
  3. Qualitative palettes do not imply magnitude differences between legend classes, and hues are used to create the primary visual differences between classes. Qualitative schemes are best suited to representing nominal or categorical data.

diverging, sequential, qualitative
qualitative map

So the "qualitative" maps (Accent, Dark2, Paired, Pastel1, Pastel2, Set1, Set2, Set3) should not be smoothly-varying.

http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=RColorBrewer:ColorBrewer

It's possible to convert these to segmented maps: https://gist.github.com/2719900#file_accent.py

Accent continuous vs segmented

Should I go through them and do that and submit a patch? I'm not sure if the matplotlib colormaps are even meant to be used for categorical data like this.

@efiring
Owner
@endolith

Ok, I wasn't aware of ListedColormap. Is there a way to use these colormaps with it? All the examples I see just use an explicit list, like cmap = mpl.colors.ListedColormap(['r', 'g', 'b', 'c'])

I wonder if the binary colormap belongs in the same group. It's produces an identical gradient to gray_r, but the example included with it only uses the most extreme values of pure white or pure black. I'm not sure why it exists.

@efiring
Owner

I think this issue can be closed, based on #921 having been merged.

@efiring efiring closed this
@endolith

#921 isn't related to this, but the docs change in #889 to discourage their use is. (endolith@cce4441#L0R1789)

@efiring
Owner

Thank you for the correction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.