Skip to content

Instantly share code, notes, and snippets.

View ianhi's full-sized avatar

Ian Hunt-Isaak ianhi

View GitHub Profile
@ianhi
ianhi / imshow_zoom.py
Last active October 14, 2020 19:45 — forked from tacaswell/simp_zoom.py
factory for adding zoom callback to matplotlib imshow - now available via https://github.com/ianhi/mpl-interactions
import matplotlib.pyplot as plt
def zoom_factory(ax,base_scale = 1.1):
"""
parameters
----------
ax : matplotlib axes object
axis on which to implement scroll to zoom
base_scale : float
how much zoom on each tick of scroll wheel