I have been trying to get the mouse x,y coordinates to variables according to matplotlib plot scale not pixels but it only returns me the integer components like 0.0 or 1.0 I want to return the accurate number like 0.1245 here is my code
import matplotlib
import Tkinter as tk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import numpy as np
import matplotlib.pyplot as plt
def onclick(self,event):
ix, iy = float(event.xdata), float(event.ydata)
print 'x = %d, y = …Run Code Online (Sandbox Code Playgroud)