Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Description
Bug summary
Colormapping of values close to normalization limits can incorrectly pass to the "other" side of the normalization limits for float32 inputs.
Bisects to#17636; seems worth marking as release critical?
Code for reproduction
frompylabimport*rcdefaults()t=loadtxt("t.txt").astype(float32)subplot(211)title("bad colormapping")imshow(t,norm=mpl.colors.LogNorm(1e4,3e8))subplot(212)title("good colormapping")imshow(t,norm=mpl.colors.LogNorm(1e4,3e8),interpolation_stage="rgba")show()
t.txt is below (20x60 array).
t.txt
58942 64279 84722 51856 50055 114166 31931 64794 104959 142180 76242 17195 38894 25839 31804 86433 170174 18076 140152 28781 113055 24886 20566 199163 186778 317594 984360 512459 1751483 3389411 31211444 3886054 1577606 288069 301913 225368 164976 138614 132365 81636 113055 362294 80226 242847 138080 208319 19660 52164 83988 121564 16671 12661 133006 48369 71139 70846 58699 47444 98991 18154451597 12785 57897 32263 74056 65077 44898 9817 110491 49241 63903 88239 60900 130296 104555 53142 271787 75386 19345 98730 81636 90156 156140 110748 302689 205094 422468 445540 3040181 6595976 36350832 5663832 2471288 476834 828630 694559 150378 385205 289452 90156 24886 114341 51327 240951 30431 239319 85250 35884 64539 16351 6221 192556 79864 9010 51667 148093 200178 56705 81576 3453219503 30237 111800 31633 27413 27873 136097 9824 12210 232044 21675 78407 22386 34806 34573 62933 235059 93267 230505 52876 132365 289452 118774 74116 228770 126393 467420 1313782 6717006 5249880 52201940 6422516 3467091 926308 657924 104105 568922 354773 118774 156140 20566 101510 59226 129772 61709 187534 350155 74662 268449 61811 165584 114944 93243 212593 37180 49567 100136 57973 132053 5460726923 47718 65038 110358 44482 52430 77177 84022 80250 127306 95651 130613 27002 39157 228334 142891 356116 155451 54868 333273 138614 385205 354773 336947 1167037 331106 346806 753847 9211976 9462781 70547808 9725218 5119318 683683 94834 410691 347623 336947 74116 110748 199163 63835 11470 80820 41228 15765 53578 152875 38890 59842 136705 68892 160746 195307 160459 197798 129277 160049 19812 4557012244 178437 99111 206084 88571 48422 157411 115388 135209 57066 52961 56398 104574 57090 376517 86079 261600 72729 271334 409143 164976 150378 568922 347623 1178153 649180 960161 5216739 9148220 15884352 96037200 11980963 4490694 2192027 1580819 858371 1178153 1167037 228770 302689 186778 305984 92220 102448 142893 206076 106498 274349 185133 106091 86607 192704 93840 74332 68584 21219 33778 163443 27021 9229132329 164155 86692 124985 96082 98376 69642 24929 76129 76726 186452 42945 145814 211285 192607 138585 41816 345575 264420 282978 225368 694559 104105 410691 858371 692663 2203776 2175977 5168049 18180770 145174368 21120186 6132431 1220932 1675978 692663 649180 331106 126393 205094 317594 179355 447791 101080 212527 538804 216707 102911 34938 74154 752779 77567 221249 75743 95070 98320 37885 109532 83205 4392479091 40389 72399 150384 41080 67003 179867 32798 81581 219346 153333 168326 160840 59061 147807 666311 359078 275864 232001 231742 301913 828630 657924 94834 1580818 1675978 2201480 1930727 9904122 27879668 188579536 37623920 11823683 3294144 2201480 2203776 960161 346806 467420 422468 984359 331264 179363 1279143 28910 177820 203292 82542 321653 152878 49501 214673 51216 422250 73355 37575 13370 20210 42246 9785933492 111170 120062 59432 54656 47767 323076 182785 114577 111761 158382 143199 152446 73415 170167 146138 63660 382964 305597 542623 288069 476834 926308 683683 2192027 1220932 3294145 4291788 20821256 32129888 412815072 68441968 23641976 4291788 1930727 2175977 5216739 753847 1313782 445540 512459 571774 411157 27346 28068 45302 235575 156757 307111 560135 145810 202935 106262 54288 311341 137071 3316 95894 91368 158422369475 384082 306384 528384 196046 478790 270935 246768 373544 389638 375584 483907 645259 503996 1632341 834880 501539 701974 1076304 1549674 1577606 2471288 3467092 5119318 4490694 6132431 11823684 23641976 61787200 346725376 849581696 202956480 61787196 20821256 9904122 5168048 9148220 9211976 6717006 3040181 1751483 1199501 1764819 1345680 1783324 1319852 1564318 1153096 377857 686835 498827 788838 571207 374124 381619 272980 388745 489991 171466 243212433585 260956 231523 508013 762529 861655 704439 915865 617364 1283795 995679 975618 1818459 2250059 2323116 1862394 2679919 3635486 2687002 4374014 3886054 5663832 6422516 9725221 11980965 21120186 37623924 68441968 202956512 831329792 10304242688 831329664 346725408 32129886 27879672 18180770 15884350 9462781 5249880 6595976 3389411 3276790 3531027 2603632 2008037 1949634 2408762 1679826 1259959 1671059 1292951 1154145 1129977 1052231 1251848 445428 587955 569234 774290 5395933038106 4505989 4844850 4124308 5429116 4229763 5436520 7197848 7500659 5115562 10591629 8376190 9306667 9335577 10894294 10362409 14645203 17283184 18426008 26417010 31211444 36350832 52201940 70547808 96037200 145174368 188579536 412815072 849581696 10304243712 28260868030464 10304242688 849581696 412815072 188579568 145174368 96037200 70547808 52201940 36350820 31211434 26417004 18426008 17283190 14645207 10362412 10894296 9335578 9306667 8376194 10591626 5115559 7500658 7197858 5436521 4229763 5429114 4124307 4844848 4505990562933 539593 774290 569234 587955 445428 1251848 1052231 1129977 1154144 1292951 1671059 1259959 1679826 2408762 1949634 2008037 2603630 3531026 3276790 3389411 6595975 5249880 9462781 15884351 18180772 27879666 32129892 346725376 831329920 10304243712 831329728 202956480 68441968 37623916 21120184 11980963 9725218 6422516 5663832 3886054 4374013 2687003 3635487 2679919 1862394 2323116 2250059 1818459 975618 995679 1283795 617364 915865 704439 861654 762529 508014 231523 26095572872 243212 171466 489991 388745 272981 381619 374124 571207 788838 498827 686835 377857 1153095 1564318 1319852 1783324 1345679 1764819 1199501 1751483 3040181 6717006 9211979 9148220 5168050 9904122 20821256 61787200 202956512 849581696 346725408 61787196 23641980 11823684 6132431 4490694 5119318 3467091 2471288 1577606 1549674 1076304 701975 501539 834880 1632341 503996 645259 483907 375584 389638 373544 246768 270935 478789 196046 528384 306384 38408282030 158422 91368 95894 3316 137071 311341 54288 106262 202935 145810 560135 307111 156757 235575 45302 28068 27346 411157 571774 512459 445540 1313782 753846 5216739 2175977 1930727 4291788 23641980 68441976 412815072 32129890 20821256 4291788 3294144 1220932 2192027 683683 926308 476834 288069 542623 305597 382964 63660 146138 170167 73415 152446 143199 158382 111761 114577 182785 323076 47767 54656 59432 120062 11117015598 97859 42246 20210 13370 37575 73355 422250 51216 214673 49501 152878 321653 82542 203292 177820 28910 1279143 179363 331264 984360 422468 467420 346806 960161 2203776 2201480 3294145 11823685 37623924 188579568 27879670 9904122 1930727 2201480 1675978 1580819 94834 657924 828630 301913 231742 232001 275865 359078 666311 147807 59061 160840 168326 153333 219346 81581 32798 179866 67003 41080 150384 72399 4038934341 43924 83205 109532 37885 98320 95070 75743 221249 77567 752779 74154 34938 102911 216707 538804 212527 101080 447791 179355 317594 205094 126393 331106 649180 692663 1675978 1220932 6132431 21120184 145174368 18180772 5168048 2175977 2203776 692663 858371 410691 104105 694559 225368 282978 264420 345575 41816 138585 192607 211285 145814 42945 186452 76726 76129 24929 69642 98376 96082 124985 86692 164155102076 92291 27021 163443 33778 21219 68584 74332 93840 192704 86607 106091 185133 274349 106498 206076 142893 102448 92220 305984 186778 302689 228770 1167037 1178153 858371 1580819 2192027 4490694 11980965 96037200 15884348 9148220 5216739 960161 649180 1178153 347623 568922 150378 164976 409143 271334 72729 261600 86079 376517 57090 104574 56398 52961 57066 135209 115388 157411 48422 88571 206084 99111 17843764592 45570 19812 160049 129277 197798 160459 195307 160746 68892 136705 59842 38890 152875 53578 15765 41228 80820 11470 63835 199163 110748 74116 336947 347623 410691 94834 683683 5119318 9725221 70547808 9462781 9211979 753847 346806 331106 1167037 336947 354773 385205 138614 333272 54868 155451 356116 142891 228334 39157 27002 130613 95651 127306 80250 84022 77177 52430 44482 110358 65038 4771837269 54607 132053 57973 100136 49567 37180 212592 93243 114944 165584 61811 268449 74662 350155 187534 61709 129772 59226 101510 20566 156140 118774 354773 568922 104105 657924 926308 3467092 6422516 52201940 5249880 6717006 1313782 467420 126393 228770 74116 118774 289452 132365 52876 230505 93267 235059 62933 34573 34806 22386 78407 21675 232044 12210 9824 136097 27873 27413 31633 111800 3023744589 34532 81576 56705 200178 148093 51667 9010 79864 192556 6221 16351 64539 35884 85250 239319 30431 240951 51327 114341 24886 90156 289452 385205 150378 694558 828630 476834 2471288 5663832 36350820 6595975 3040181 445540 422468 205094 302689 110748 156140 90156 81636 98730 19345 75386 271787 53142 104555 130296 60900 88239 63903 49241 110491 9817 44898 65077 74056 32263 57897 12785Actual outcome
(github doesn't seem to want to let me attach an example image; I'll try again another time but in the meantime the example should be enough to repro.)
Note the spurious discontinuity in the top plot around the dark "under" pixels.
Expected outcome
Same as with interpolation_stage="rgba" (which really does nothing here, as the image pixels are much bigger than the rendering pixels).
Operating system
No response
Matplotlib Version
3.5b1
Matplotlib Backend
qt5agg
Python version
3.9
Jupyter version
No response
Other libraries
No response
Installation
No response
Conda channel
No response