Resetting the position & zoom? #459
-
Hello, I'm trying to migrate from MPL-based solution and I've gotten used to its "Home" button functionality. What it does is it fits the data onto the screen effectively resetting the zoom and the visible ranges. I haven't found such functionality in the finplot, so I'm doing the following: orig = fplt._key_pressed
def _key_pressed(vb, ev):
if ev.text() == 'h':
vb.v_zoom_scale = 1
fplt.refresh()
else:
return orig(vb, ev)
return True
fplt._key_pressed = _key_pressed It seems to work correctly, but I'm not sure if I just didn't hit the issue yet. What would be the correct way to reset the view? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi naquad, not sure what you mean by resetting the zoom and visible ranges. To what? To totally zoomed out? To what was loaded (last or when starting)? Just resetting the Y-zoom to default? If the latter, then yeah, you've absolutely nailed it! :) |
Beta Was this translation helpful? Give feedback.
Hi naquad, not sure what you mean by resetting the zoom and visible ranges. To what? To totally zoomed out? To what was loaded (last or when starting)? Just resetting the Y-zoom to default? If the latter, then yeah, you've absolutely nailed it! :)