Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple pcolormesh data explorer
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
def main():
data = np.random.random((10,10,10))
ex = Explorer(data)
class Explorer(object):
def __init__(self, data): = data
nz =[0] - 1
self.fig, = plt.subplots()'Slices along the first axes')
self.sliderax = self.fig.add_axes([0.2, 0.02, 0.65, 0.04])
self.slider = Slider(self.sliderax, 'Slice', 0, nz, valinit=0)
self.slider.on_changed(self.update) =[0,:,:], vmin=data.min(), vmax=data.max())
def update(self, i):[int(i),:,:].ravel())
def show(self):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.