Commit cc5929d
Fix shared Normalize causing out-of-range values in multi-channel rendering
The root cause of matplotlib's "Clipping input data" warning was that a
single Normalize instance was shared across all channels. It auto-ranged
on the first channel's min/max, causing subsequent channels with different
value ranges to normalize outside [0, 1].
Fix: when the shared norm has auto-ranging (vmin=None or vmax=None), copy
it per channel so each channel normalizes independently. This replaces
the previous approach of clipping the final array.
Additive compositing paths (palette, categorical) still clip after
summing, since summing RGBA values can inherently exceed [0, 1].
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent dc490c9 commit cc5929d
1 file changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1201 | 1201 | | |
1202 | 1202 | | |
1203 | 1203 | | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
1204 | 1208 | | |
1205 | 1209 | | |
1206 | 1210 | | |
| |||
1229 | 1233 | | |
1230 | 1234 | | |
1231 | 1235 | | |
1232 | | - | |
| 1236 | + | |
1233 | 1237 | | |
1234 | 1238 | | |
1235 | 1239 | | |
| |||
1246 | 1250 | | |
1247 | 1251 | | |
1248 | 1252 | | |
1249 | | - | |
| 1253 | + | |
1250 | 1254 | | |
1251 | 1255 | | |
1252 | 1256 | | |
1253 | 1257 | | |
1254 | 1258 | | |
1255 | 1259 | | |
1256 | 1260 | | |
1257 | | - | |
| 1261 | + | |
1258 | 1262 | | |
1259 | 1263 | | |
1260 | 1264 | | |
| |||
1291 | 1295 | | |
1292 | 1296 | | |
1293 | 1297 | | |
1294 | | - | |
| 1298 | + | |
1295 | 1299 | | |
1296 | 1300 | | |
1297 | 1301 | | |
| |||
1305 | 1309 | | |
1306 | 1310 | | |
1307 | 1311 | | |
1308 | | - | |
| 1312 | + | |
1309 | 1313 | | |
1310 | 1314 | | |
1311 | | - | |
| 1315 | + | |
1312 | 1316 | | |
1313 | 1317 | | |
1314 | 1318 | | |
| |||
1327 | 1331 | | |
1328 | 1332 | | |
1329 | 1333 | | |
1330 | | - | |
| 1334 | + | |
1331 | 1335 | | |
1332 | 1336 | | |
1333 | 1337 | | |
| |||
0 commit comments