def __init__(self, U, parent, grid, count, vmin=None, vmax=None, legend=None, codim=1, separate_plots=False, dpi=100):
    assert isinstance(grid, OnedGrid)
    assert (codim in (0, 1))
    figure = Figure(dpi=dpi)
    if (not separate_plots):
        axes = figure.gca()
    self.codim = codim
    lines = ()
    centers = grid.centers(1)
    if grid.identify_left_right:
        centers = np.concatenate((centers, [[grid.domain[1]]]), axis=0)
        self.periodic = True
    else:
        self.periodic = False
    if (codim == 1):
        xs = centers
    else:
        xs = np.repeat(centers, 2)[1:(- 1)]
    for i in range(count):
        if separate_plots:
            figure.add_subplot((int((count / 2)) + (count % 2)), 2, (i + 1))
            axes = figure.gca()
            pad = ((vmax[i] - vmin[i]) * 0.1)
            axes.set_ylim((vmin[i] - pad), (vmax[i] + pad))
        (l,) = axes.plot(xs, np.zeros_like(xs))
        lines = (lines + (l,))
        if (legend and separate_plots):
            axes.legend([legend[i]])
    if (not separate_plots):
        pad = ((max(vmax) - min(vmin)) * 0.1)
        axes.set_ylim((min(vmin) - pad), (max(vmax) + pad))
        if legend:
            axes.legend(legend)
    self.lines = lines
    super().__init__(figure)
    self.setParent(parent)
    self.setMinimumSize(300, 300)
    self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding))
def __init__(self, U, parent, grid, count, vmin=None, vmax=None, legend=None, codim=1, separate_plots=False, dpi=100):
    assert isinstance(grid, OnedGrid)
    assert (codim in (0, 1))
    figure = Figure(dpi=dpi)
    if (not separate_plots):
        axes = figure.gca()
    self.codim = codim
    lines = ()
    centers = grid.centers(1)
    if grid.identify_left_right:
        centers = np.concatenate((centers, [[grid.domain[1]]]), axis=0)
        self.periodic = True
    else:
        self.periodic = False
    if (codim == 1):
        xs = centers
    else:
        xs = np.repeat(centers, 2)[1:(- 1)]
    for i in range(count):
        if separate_plots:
            figure.add_subplot((int((count / 2)) + (count % 2)), 2, (i + 1))
            axes = figure.gca()
            pad = ((vmax[i] - vmin[i]) * 0.1)
            axes.set_ylim((vmin[i] - pad), (vmax[i] + pad))
        (l,) = axes.plot(xs, np.zeros_like(xs))
        lines = (lines + (l,))
        if (legend and separate_plots):
            axes.legend([legend[i]])
    if (not separate_plots):
        pad = ((max(vmax) - min(vmin)) * 0.1)
        axes.set_ylim((min(vmin) - pad), (max(vmax) + pad))
        if legend:
            axes.legend(legend)
    self.lines = lines
    super().__init__(figure)
    self.setParent(parent)
    self.setMinimumSize(300, 300)
    self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding))