From fa58f2935754e1776f8127ed6335ff33e52f2a7c Mon Sep 17 00:00:00 2001 From: Maximilian Weigand Date: Wed, 28 Aug 2024 12:20:27 +0200 Subject: [PATCH] Profile mode: Use mouse-click location as default for hyperbola plotting When in profile mode, clicking anywhere on the figure will store this location as a default value for the "show hyperb" button. --- gprpy/gprpyGUI.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gprpy/gprpyGUI.py b/gprpy/gprpyGUI.py index a34af22..0dd049a 100644 --- a/gprpy/gprpyGUI.py +++ b/gprpy/gprpyGUI.py @@ -836,6 +836,9 @@ def plotProfileData(self,proj,fig,a,canvas): def moved(event): if event.xdata is not None and event.ydata is not None: canvas.get_tk_widget().itemconfigure(tag, text="(x = %5.5g, y = %5.5g)" % (event.xdata, event.ydata)) + # use these coordinates as starting values for Hyperbolae + self.hypx = event.xdata + self.hypt = event.ydata self.cursor_cid = canvas.mpl_connect('button_press_event', moved) tag = canvas.get_tk_widget().create_text(20, 20, text="", anchor="nw")