Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9d3c83

Browse files
authored
Merge pull request #14080 from meeseeksmachine/auto-backport-of-pr-14069-on-v3.1.x
Backport PR #14069 on branch v3.1.x (Don't try to use the colorbar formatter to format RGBA data.)
2 parents af7f6b5 + 74f0f0a commit b9d3c83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ def get_cursor_data(self, event):
933933
return arr[i, j]
934934

935935
def format_cursor_data(self, data):
936-
if self.colorbar:
936+
if np.ndim(data) == 0 and self.colorbar:
937937
return (
938938
"["
939939
+ cbook.strip_math(

0 commit comments

Comments
 (0)