<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plot(self, x, y, title, ylabel, scale='semilogy', idx_lim=(1, -1)):
 """Plot the data. Parameters x : ndarray vector with frequencies y : ndarray vector with amplitudes title : str title of the plot, to appear above it ylabel : str label for the y-axis scale : str 'log y-axis', 'log both axes' or 'linear', to set axis scaling idx_lim : tuple of (int or None) indices of the data to plot. by default, the first value is left out, because of assymptotic tendencies near 0 Hz. """

        x = x[slice(*idx_lim)]
        y = y[slice(*idx_lim)]
        ax = self.figure.add_subplot(111)
        ax.set_title(title)
        ax.set_xlabel('Frequency (Hz)')
        ax.set_ylabel(ylabel)

        if 'semilogy' == scale:
            ax.semilogy(x, y, 'r-')
        elif 'loglog' == scale:
            ax.loglog(x, y, 'r-')
        elif 'linear' == scale:
            ax.plot(x, y, 'r-')