def __init__(self, figure, sync_timer, grid, U=None, vmin=None, vmax=None, codim=2, separate_axes=False, columns=2, aspect_ratio=1):
    self.vmin = vmin
    self.vmax = vmax
    self.codim = codim
    self.grid = grid
    if separate_axes:
        if (len(U) == 1):
            columns = 1
        rows = int(np.ceil((len(U) / columns)))
        self.ax = figure.subplots(rows, columns, squeeze=False).flatten()
    else:
        self.ax = (figure.gca(),)
    for ax in self.ax:
        ax.set_aspect(aspect_ratio)
    self.figure = figure
    self.codim = codim
    self.grid = grid
    self.separate_axes = separate_axes
    self.count = (len(U) if (separate_axes or isinstance(U, tuple)) else 1)
    self.aspect_ratio = aspect_ratio
    self._plot_init()
    self.U = U
    if ((U is not None) and (not separate_axes) and (self.count == 1)):
        assert (len(self.ax) == 1)
        delay_between_frames = 200
        self.anim = animation.FuncAnimation(figure, self.animate, frames=U, interval=delay_between_frames, blit=True, event_source=sync_timer)
        self.html = HTML(self.anim.to_jshtml())
    else:
        self.set(self.U)
def __init__(self, figure, sync_timer, grid, U=None, vmin=None, vmax=None, codim=2, separate_axes=False, columns=2, aspect_ratio=1):
    self.vmin = vmin
    self.vmax = vmax
    self.codim = codim
    self.grid = grid
    if separate_axes:
        if (len(U) == 1):
            columns = 1
        rows = int(np.ceil((len(U) / columns)))
        self.ax = figure.subplots(rows, columns, squeeze=False).flatten()
    else:
        self.ax = (figure.gca(),)
    for ax in self.ax:
        ax.set_aspect(aspect_ratio)
    self.figure = figure
    self.codim = codim
    self.grid = grid
    self.separate_axes = separate_axes
    self.count = (len(U) if (separate_axes or isinstance(U, tuple)) else 1)
    self.aspect_ratio = aspect_ratio
    self._plot_init()
    self.U = U
    if ((U is not None) and (not separate_axes) and (self.count == 1)):
        assert (len(self.ax) == 1)
        delay_between_frames = 200
        self.anim = animation.FuncAnimation(figure, self.animate, frames=U, interval=delay_between_frames, blit=True, event_source=sync_timer)
        self.html = HTML(self.anim.to_jshtml())
    else:
        self.set(self.U)