Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c27dd78

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

File tree

Expand file treeCollapse file tree

5 files changed

+490
-1104
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+490
-1104
lines changed
+11Lines 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())
+9Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.