Closed MestreLion closed 1 month ago
I don't think this is expected to work, sorry!
Preliminary findings:
xticklabels
/yticklabels
are set for pcolormesh
: the underlying format_xdata()
ends up calling the major tick value formatter, which returns ""
for values that are not in the tick labels dictionary.x= y=
imshow
suffers the same problem as pcolormesh
, however it sets its artists in a way (mouseover=True
perhaps?) that they are queried for additional info, hence the additional [123..]
shown on mouseover. But unfortunately Seaborn does not use imshow
Some workarounds that Seaborn could adopt:
ax.fmt_xdata
/ ax.fmt_ydata
, which are None
by default, to prevent ax.format_xdata()
from falling back to the tick formatter
This is much better explained in this SO question: Interactive sns.heatmap displays x, y only hovering over the colorbar
The comments suggest this is easy to implement, but I was unable to do so.
It does work fine if you replace the seaborn
heatmap()
call with direct calls to Matplotlib'spcolormesh()
+colorbar()
, i.e, instead of:Use this
So something in Seaborn's usage or customization of Matplotlib's
pcolormesh
is "unsetting" its defaultformat_coords
, which I believe is a bug