Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Commitce488f5
Make ListedColormap.monochrome a property
The calculated property replaces the attribute *monochome*, which wasmanually set on `__init__`, but was not correctly set for all possibleinputs.This property ensures consistency and simplifies initialization at thecost of some computation overhead to determine whether the colormap ismonochrome.The computation cost is bearable (even without caching), because it'sonly used in `ContourSet._process_colors`.It's a separate discussion whether we need this property on colormaps atall (at least as public API). Usually, colormaps are not monochromeand monochrome colormaps are a very special edge case used in contoursonly. We may eventually deprecate it, but since it is currently publicAPI, let's leave it for now.There's also a technical API incompatibility in that users cannot setthe attribute anymore, but I'd argue that that has never been intendedand there's no practical use-case, so I refrain from the extra hassleof allowing setting this property.Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>1 parentca39d41 commitce488f5
3 files changed
+23
-6
lines changedLines changed: 15 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1191 | 1191 |
| |
1192 | 1192 |
| |
1193 | 1193 |
| |
1194 |
| - | |
1195 | 1194 |
| |
1196 | 1195 |
| |
1197 | 1196 |
| |
1198 | 1197 |
| |
1199 | 1198 |
| |
1200 | 1199 |
| |
1201 |
| - | |
1202 | 1200 |
| |
1203 |
| - | |
1204 |
| - | |
1205 | 1201 |
| |
1206 | 1202 |
| |
1207 | 1203 |
| |
| |||
1211 | 1207 |
| |
1212 | 1208 |
| |
1213 | 1209 |
| |
1214 |
| - | |
1215 | 1210 |
| |
1216 | 1211 |
| |
1217 | 1212 |
| |
| |||
1220 | 1215 |
| |
1221 | 1216 |
| |
1222 | 1217 |
| |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1223 | 1233 |
| |
1224 | 1234 |
| |
1225 | 1235 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
130 | 130 |
| |
131 | 131 |
| |
132 | 132 |
| |
133 |
| - | |
134 | 133 |
| |
135 | 134 |
| |
136 | 135 |
| |
137 | 136 |
| |
| 137 | + | |
| 138 | + | |
138 | 139 |
| |
139 | 140 |
| |
140 | 141 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
77 | 83 |
| |
78 | 84 |
| |
79 | 85 |
| |
|
0 commit comments
Comments
(0)