Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Commit02a0455
committed
Improve formatting of imshow() cursor data when a colorbar exists.
When a colorbar exists, use its formatter to format cursor data.For example, after```imshow([[10000, 10001]]); colorbar()```currently the cursor data on either pixel is rendered as 1e4, but afterthis patch it becomes 0.0+1e4 / 1.0+1e4, or 10000.0 / 10001.0 if`rcParams["axes.formatter.useoffset"]` is set to False. (Even thoughthe version with the offset text may not be the most esthetic, it'sclearly more informative than the current behavior...)It would be nice if this worked even for ScalarMappables that don'thave a colorbar; this may include extracting the Formatter selectioncode out of the colorbar code into something generally applicable toScalarMappables, or just generating a hidden colorbar "on-the-fly" ifneeded just for the purpose of getting its Formatter.1 parentf93222a commit02a0455
3 files changed
+21
-7
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
| 4 | + | |
4 | 5 |
| |
5 | 6 |
| |
6 | 7 |
| |
| |||
1159 | 1160 |
| |
1160 | 1161 |
| |
1161 | 1162 |
| |
1162 |
| - | |
1163 |
| - | |
| 1163 | + | |
| 1164 | + | |
1164 | 1165 |
| |
1165 | 1166 |
| |
1166 | 1167 |
| |
|
Lines changed: 11 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
302 | 302 |
| |
303 | 303 |
| |
304 | 304 |
| |
305 |
| - | |
306 |
| - | |
307 |
| - | |
308 |
| - | |
309 |
| - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
310 | 316 |
| |
311 | 317 |
| |
312 | 318 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
907 | 907 |
| |
908 | 908 |
| |
909 | 909 |
| |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
910 | 917 |
| |
911 | 918 |
| |
912 | 919 |
| |
|
0 commit comments
Comments
(0)