@staticmethod
def get_plot_data(data, xaxis=None):
    """Helper function, interprets the plot data returned by a datafunc.
        'data' is input data as returned by the datafunc argument to make_figure() below.
        'xaxis' is default X axis, Note to use ordinal numbering.
        Return value is tuple of X,Y,Yerr. Yerr is None if no error bars are provided.
        """
    if isinstance(data, tuple):
        if len(data) == 2:
            x, y = data
            yerr = None
        elif len(data) == 3:
            x, y, yerr = data
        else:
            raise TypeError(
                'incorrect datum returned: 2- or 3-tuple expected, got %d-tuple'
                 % len(data))
    else:
        y = data
        x = yerr = None
    if x is None:
        x = list(range(len(y))) if xaxis is None else xaxis
    if len(x) != len(y):
        raise TypeError(
            'misshaped datum returned: %d X elements, %d Y elements' % (len
            (x), len(y)))
    if yerr is not None and len(yerr) != len(y):
        raise TypeError(
            'misshaped datum returned: %d Y elements, %d Yerr elements' % (
            len(y), len(yerr)))
    return x, y, yerr
