Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c27dd78

Browse files
committed
Merge pull request #3973 from endolith/Qualitative_ListedColormap
API: Convert qualitative colormaps to ListedColormap
1 parent 3a5f06f commit c27dd78

File tree

5 files changed

+490
-1104
lines changed

5 files changed

+490
-1104
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Qualitative colormaps
2+
---------------------
3+
4+
Colorbrewer's qualitative/discrete colormaps ("Accent", "Dark2", "Paired",
5+
"Pastel1", "Pastel2", "Set1", "Set2", "Set3") are now implemented as
6+
``ListedColormap`` instead of ``LinearSegmentedColormap``.
7+
8+
To use these for images where categories are specified as integers, for
9+
instance, use::
10+
11+
plt.imshow(x, cmap='Dark2', norm=colors.NoNorm())
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Qualitative colormaps
2+
---------------------
3+
4+
ColorBrewer's "qualitative" colormaps ("Accent", "Dark2", "Paired",
5+
"Pastel1", "Pastel2", "Set1", "Set2", "Set3") were intended for discrete
6+
categorical data, with no implication of value, and therefore have been
7+
converted to ``ListedColormap`` instead of ``LinearSegmentedColormap``, so
8+
the colors will no longer be interpolated and they can be used for
9+
choropleths, labeled image features, etc.

0 commit comments

Comments
 (0)