<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def appendData(self, xdata, ydata, color='b', legendstr=None):
 """Adds the data to the plot :param xdata: index values for data, plotted on x-axis :type xdata: numpy.ndarray :param ydata: value data to plot, dimension must match xdata :type ydata: numpy.ndarray """

        item = self.plot(xdata, ydata, pen=color)
        if legendstr is not None:
            self.legend.addItem(item, legendstr)
        return item