Commit 05a5db0
committed
Cast vmin/vmax to floats before nonsingular-expanding them.
Nonsingular-expansion is fundamentally about adding small floats to
separate vmin/vmax so casting to float is normal; this avoids running
into plain wrong autoscales with
```
im = imshow([[np.int16(-20000), np.int16(20000)]])
colorbar()
print(im.norm.vmin, im.norm.vmax)
```
or
```
im = imshow([[np.int16(-32768), np.int16(0)]])
colorbar()
print(im.norm.vmin, im.norm.vmax)
```
(The bug is present as far back as 2.2.0.)1 parent 58c6698 commit 05a5db0
2 files changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2791 | 2791 | | |
2792 | 2792 | | |
2793 | 2793 | | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
2794 | 2798 | | |
2795 | 2799 | | |
2796 | 2800 | | |
| |||
0 commit comments