Commit 7e0ac97
committed
Deprecate ListedColormap(..., N=...) parameter
Truncating or repeating the given colors to a specific value of N
is not within the scope of colormaps. Instead, users should
create an appropriate color list themselves and feed that to
ListedColormap.
Also the current behavior can be surprising: It may well be that
a given N was intended to truncate, but depending on the list, it
could repeat. Repeated colors in a colormap are dangerous / often
not intentended because they create an ambiguity in the color ->
value mapping.1 parent 61f4d50 commit 7e0ac97
File tree
6 files changed
+62
-10
lines changed- lib/matplotlib
- tests
6 files changed
+62
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1739 | 1739 | | |
1740 | 1740 | | |
1741 | 1741 | | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
1742 | 1762 | | |
1743 | 1763 | | |
1744 | 1764 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1195 | 1195 | | |
1196 | 1196 | | |
1197 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1198 | 1204 | | |
1199 | 1205 | | |
1200 | 1206 | | |
| |||
1259 | 1265 | | |
1260 | 1266 | | |
1261 | 1267 | | |
1262 | | - | |
| 1268 | + | |
1263 | 1269 | | |
1264 | 1270 | | |
1265 | 1271 | | |
| |||
1943 | 1949 | | |
1944 | 1950 | | |
1945 | 1951 | | |
1946 | | - | |
| 1952 | + | |
| 1953 | + | |
1947 | 1954 | | |
1948 | 1955 | | |
1949 | 1956 | | |
1950 | 1957 | | |
1951 | 1958 | | |
1952 | 1959 | | |
1953 | | - | |
| 1960 | + | |
| 1961 | + | |
1954 | 1962 | | |
1955 | 1963 | | |
1956 | 1964 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
| |||
738 | 742 | | |
739 | 743 | | |
740 | 744 | | |
741 | | - | |
| 745 | + | |
| 746 | + | |
742 | 747 | | |
743 | 748 | | |
744 | 749 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
466 | 483 | | |
467 | 484 | | |
468 | 485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
1168 | | - | |
1169 | | - | |
| 1168 | + | |
| 1169 | + | |
1170 | 1170 | | |
1171 | 1171 | | |
1172 | 1172 | | |
| |||
0 commit comments