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

Skip to content

Commit 1009c14

Browse files
authored
Merge pull request #14069 from anntzer/rgba_colorbar_formatcursordata
Don't try to use the colorbar formatter to format RGBA data.
2 parents 0ac953d + 17420ec commit 1009c14

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
@@ -930,7 +930,7 @@ def get_cursor_data(self, event):
930930
return arr[i, j]
931931

932932
def format_cursor_data(self, data):
933-
if self.colorbar:
933+
if np.ndim(data) == 0 and self.colorbar:
934934
return (
935935
"["
936936
+ cbook.strip_math(

0 commit comments

Comments
 (0)