Commit 44b9873
committed
MNT: Refactor from_levels_and_colors()
Primary motivation was to remove the N parameter to ListedColormap (in
preparation of its deprecation
matplotlib#28763 (comment)
-2322791660).
That parameter is not needed here because
`len(colors[color_slice]) == n_data_colors)`, otherwise the ValueError
above would have raised.
Hopefully, this is overall more readable.1 parent ca39d41 commit 44b9873
1 file changed
+11
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3690 | 3690 | | |
3691 | 3691 | | |
3692 | 3692 | | |
3693 | | - | |
| 3693 | + | |
| 3694 | + | |
3694 | 3695 | | |
3695 | 3696 | | |
3696 | | - | |
3697 | | - | |
3698 | | - | |
3699 | | - | |
3700 | | - | |
3701 | | - | |
3702 | | - | |
3703 | | - | |
3704 | | - | |
3705 | | - | |
3706 | | - | |
3707 | | - | |
3708 | | - | |
3709 | | - | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
3710 | 3706 | | |
3711 | 3707 | | |
3712 | 3708 | | |
| |||
0 commit comments