def plot_average(sdat, lovs):
steps_iter = iter(sdat.walk.filter(rprof=True))<EOL>try:<EOL><INDENT>step = next(steps_iter)<EOL><DEDENT>except StopIteration:<EOL><INDENT>return<EOL><DEDENT>sovs = misc.set_of_vars(lovs)<EOL>istart = step.istep<EOL>nprofs = <NUM_LIT:1><EOL>rprof_averaged = {}<EOL>rads = {}<EOL>metas = {}<EOL>for rvar in sovs:<EOL><INDENT>rprof_averaged[rvar], rad, metas[rvar] = get_rprof(step, rvar)<EOL>if rad is not None:<EOL><INDENT>rads[rvar] = rad<EOL><DEDENT><DEDENT>for step in steps_iter:<EOL><INDENT>nprofs += <NUM_LIT:1><EOL>for rvar in sovs:<EOL><INDENT>rprof_averaged[rvar] += get_rprof(step, rvar)[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>ilast = step.istep<EOL>for rvar in sovs:<EOL><INDENT>rprof_averaged[rvar] /= nprofs<EOL><DEDENT>rcmb, rsurf = misc.get_rbounds(step)<EOL>rprof_averaged['<STR_LIT>'] = (step.sdat.scale(rcmb, '<STR_LIT:m>')[<NUM_LIT:0>],<EOL>step.sdat.scale(rsurf, '<STR_LIT:m>')[<NUM_LIT:0>])<EOL>rprof_averaged['<STR_LIT:r>'] = get_rprof(step, '<STR_LIT:r>')[<NUM_LIT:0>] + rprof_averaged['<STR_LIT>'][<NUM_LIT:0>]<EOL>stepstr = '<STR_LIT>'.format(istart, ilast)<EOL>_plot_rprof_list(sdat, lovs, rprof_averaged, metas, stepstr, rads)<EOL>
Plot time averaged profiles.

    Args:
        sdat (:class:`~stagpy.stagyydata.StagyyData`): a StagyyData instance.
        lovs (nested list of str): nested list of profile names such as
            the one produced by :func:`stagpy.misc.list_of_vars`.

    Other Parameters:
        conf.core.snapshots: the slice of snapshots.
        conf.conf.timesteps: the slice of timesteps.