1
0
Fork 0

Merge pull request #3 from xmichaelx/main

Added support for b, v keypress from original strf
merge-requests/2/head
Cees Bassa 2022-06-21 12:21:11 +02:00 committed by GitHub
commit 9136996e9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -43,13 +43,16 @@ if __name__ == "__main__":
mark = ax.scatter([], [],c="white",s=5)
line_fitting = ax.scatter([], [], edgecolors="yellow",s=10, facecolors='none')
# imshow(ax, s.z, vmin=vmin, vmax=vmax)
imshow(ax, s.z, origin="lower", aspect="auto", interpolation="None",
image = imshow(ax, s.z, origin="lower", aspect="auto", interpolation="None",
vmin=vmin, vmax=vmax,
extent=[tmin, tmax, fmin, fmax])
mode = {
"current_mode" : None
"current_mode" : None,
"vmin" : vmin,
"vmax" : vmax
}
def line_select_callback(eclick, erelease):
x1, y1 = eclick.xdata, eclick.ydata
x2, y2 = erelease.xdata, erelease.ydata
@ -109,6 +112,14 @@ if __name__ == "__main__":
mark.set_offsets(np.empty((0, 2), float))
line_fitting.set_offsets(np.empty((0, 2), float))
fig.canvas.draw()
elif key == "b":
mode["vmax"] *= 0.95
image.set_clim(mode["vmin"],mode["vmax"])
fig.canvas.draw()
elif key == "v":
mode["vmax"] *= 1.05
image.set_clim(mode["vmin"],mode["vmax"])
fig.canvas.draw()
sys.stdout.flush()