(self, data_len)
Initialize plots based off the length of the data array.
Initialize plots based off the length of the data array.
Initialize plots based off the length of the data array .
def init(self, data_len):
        """
        Initialize plots based off the length of the data array.
        """
        self._t = 0
        self._data_len = data_len
        self._data = np.empty((0, data_len))

        cm = plt.get_cmap('spectral')
        self._plots = []
        for i in range(data_len):
            color = cm(1.0 * i / data_len)
            alpha = self._alphas[i] if self._alphas is not None else 1.0
            label = self._labels[i] if self._labels is not None else str(i)
            self._plots.append(
                self._ax.plot([], [], color=color, alpha=alpha, label=label)[0]
            )
        self._ax.set_xlim(0, self._time_window)
        self._ax.set_ylim(0, 1)
        self._ax.legend(loc='upper left', bbox_to_anchor=(0, 1.15))

        self._init = True
def init ( self , data_len ) : self . _t = 0 self . _data_len = data_len self . _data = np . empty ( ( 0 , data_len ) ) cm = plt . get_cmap ( 'spectral' ) self . _plots = [ ] for i in range ( data_len ) : color = cm ( 1.0 * i / data_len ) alpha = self . _alphas [ i ] if self . _alphas is not None else 1.0 label = self . _labels [ i ] if self . _labels is not None else str ( i ) self . _plots . append ( self . _ax . plot ( [ ] , [ ] , color = color , alpha = alpha , label = label ) [ 0 ] ) self . _ax . set_xlim ( 0 , self . _time_window ) self . _ax . set_ylim ( 0 , 1 ) self . _ax . legend ( loc = 'upper left' , bbox_to_anchor = ( 0 , 1.15 ) ) self . _init = True