'Show x-delta and y-delta on matplotlib plot

Is there a way to show the x-delta and y-delta interactively on a matplotlib plot? The plot would start measuring the delta after the plot is clicked and update based on the hover location of the mouse while showing the readout somewhere on the plot. Does this feature exist?



Solution 1:[1]

The mode in which you are trying to open the file is not valid that's why U are unable to read the file. Try using r+ mode to open, read and write (if already exists) the file.

import tkinter as tk
from tkinter import filedialog

root = tk.Tk()
root.withdraw()

filedir = filedialog.askopenfilename()
print(filedir)

items = open(filedir, 'r+')

text = items.read()
print(text)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gahan Vig