<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( data, name, format='png', suffix='', path='./', common_scale=True, datarange=(None, None), fontmap=None, verbose=1, new=True, last=True, rows=1, num=1):
 """ Generates summary plots for nodes of a given PyMC object. :Arguments: data: PyMC object, trace or array A trace from an MCMC sample or a PyMC object with one or more traces. name: string The name of the object. format (optional):
 string Graphic output format (defaults to png). suffix (optional):
 string Filename suffix. path (optional):
 string Specifies location for saving plots (defaults to local directory). common_scale (optional):
 bool Specifies whether plots of multivariate nodes should be on the same scale (defaults to True). datarange (optional):
 tuple or list Range of data to plot (defaults to empirical range of data) fontmap (optional):
 dict Dictionary containing the font map for the labels of the graphic. verbose (optional):
 int Verbosity level for output (defaults to 1). """

    if fontmap is None:
        fontmap = {1: 10, 2: 8, 3: 6, 4: 5, 5: 4}

    # If there is only one data array, go ahead and plot it ...
    if ndim(data) == 1:

        if verbose > 0:
            print_('Plotting', name)

        # If new plot, generate new frame
        if new:
            figure(figsize=(10, 6))

        # Call trace
        trace(data, name, datarange=datarange, rows=rows * 2, columns=2,  
                 num=num + 3 * (num - 1), last=last, fontmap=fontmap)
        # Call autocorrelation
        autocorrelation(data, name, rows=rows * 2, columns=2, 
                    num=num+3*(num-1)+2, last=last, fontmap=fontmap)
        # Call histogram
        histogram(data, name, datarange=datarange, rows=rows, columns=2,
                 num=num*2, last=last, fontmap=fontmap)

        if last:
            if not os.path.exists(path):
                os.mkdir(path)
            if not path.endswith('/'):
                path += '/'
            savefig("%s%s%s.%s" % (path, name, suffix, format))

    else:
        # ... otherwise plot recursively
        tdata = swapaxes(data, 0, 1)

        datarange = (None, None)
        # Determine common range for plots
        if common_scale:
            datarange = (nmin(tdata), nmax(tdata))

        # How many rows?
        _rows = min(4, len(tdata))

        for i in range(len(tdata)):

            # New plot or adding to existing?
            _new = not i % _rows
            # Current subplot number
            _num = i % _rows + 1
            # Final subplot of current figure?
            _last = (_num == _rows) or (i == len(tdata) - 1)

            plot(tdata[i], name + '_' + str(i), format=format, path=path,
                common_scale=common_scale, datarange=datarange,
                suffix=suffix, new=_new, last=_last, rows=_rows, 
                num=_num, fontmap=fontmap, verbose=verbose)