title: How do I display the value of a heatmap element by hovering the cursor over it?
body: <p>I would like to display the value of a particular element of a heatmap when I hover the mouse over it.</p>
  
  <p>I have got it to display the value of the heatmap but it displayed information I do not want as well and when I first run the program, there are a lot of errors and I cannot figure out why.</p>
  
  <p>I have tried various methods of displaying the value that I have seen online, such as <code>datacursor(hover=True)</code> but <code>mplcursors.cursor(hover=True)</code> is the only one that 'works'.</p>
  
  <pre><code>import tkinter as tk                                                    
  from tkinter import ttk
  from tkinter import messagebox
  import numpy as np
  from math import pi
  import random
  import matplotlib.pyplot as plt
  
  from mpldatacursor import datacursor
  import mplcursors
  
  from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
  
  
  import pandas as pd
  from openpyxl import load_workbook
  from tkinter import filedialog
  
  root = tk.Tk()                                                          
  root.title("Stage 2 GUI")                                               
  root.geometry("1270x590")  
  
  mapArr = np.zeros([2,2],dtype=float)
  
  mapArr=([113,62,31,63],
          [50,101,72,47],
          [92,10,40,12],
          [83,21,128,16])
  
  xy=(['A','B','C','D','E','F'])
  
  
  figure, axis = plt.subplots(figsize=(8,7))                              
  heatmap = axis.imshow(
      mapArr,cmap="gray",interpolation='nearest',vmin=0, vmax=128)        
  
  heatmap.axes.get_xaxis().set_visible(False)                             
  heatmap.axes.get_yaxis().set_visible(False)
  
  cb = figure.colorbar(heatmap)                                           
  
  canvas = FigureCanvasTkAgg(figure, root)                                
  canvas.get_tk_widget().place(x=-60,y=-60)                               
  
  mplcursors.cursor(hover=True)
  
  plt.show()
  
  </code></pre>
  
  <p>I would like to display the value of the heatmap element but not the x and y coordinates but I am not sure how to remove/ customise the information displayed and I would like it if there were not errors whenever I run the program (even if it technically does work).</p>