def plot(parameterized, fignum=None, ax=None, colors=None, figsize=(<NUM_LIT:12>, <NUM_LIT:6>)):
if ax is None:<EOL><INDENT>fig = pb.figure(num=fignum, figsize=figsize)<EOL><DEDENT>if colors is None:<EOL><INDENT>from ..Tango import mediumList<EOL>from itertools import cycle<EOL>colors = cycle(mediumList)<EOL>pb.clf()<EOL><DEDENT>else:<EOL><INDENT>colors = iter(colors)<EOL><DEDENT>lines = []<EOL>fills = []<EOL>bg_lines = []<EOL>means, variances = parameterized.mean.values, parameterized.variance.values<EOL>x = np.arange(means.shape[<NUM_LIT:0>])<EOL>for i in range(means.shape[<NUM_LIT:1>]):<EOL><INDENT>if ax is None:<EOL><INDENT>a = fig.add_subplot(means.shape[<NUM_LIT:1>], <NUM_LIT:1>, i + <NUM_LIT:1>)<EOL><DEDENT>elif isinstance(ax, (tuple, list)):<EOL><INDENT>a = ax[i]<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>bg_lines.append(a.plot(means, c='<STR_LIT:k>', alpha=<NUM_LIT>))<EOL>lines.extend(a.plot(x, means.T[i], c=next(colors), label=r"<STR_LIT>".format(i)))<EOL>fills.append(a.fill_between(x,<EOL>means.T[i] - <NUM_LIT:2> * np.sqrt(variances.T[i]),<EOL>means.T[i] + <NUM_LIT:2> * np.sqrt(variances.T[i]),<EOL>facecolor=lines[-<NUM_LIT:1>].get_color(),<EOL>alpha=<NUM_LIT>))<EOL>a.legend(borderaxespad=<NUM_LIT:0.>)<EOL>a.set_xlim(x.min(), x.max())<EOL>if i < means.shape[<NUM_LIT:1>] - <NUM_LIT:1>:<EOL><INDENT>a.set_xticklabels('<STR_LIT>')<EOL><DEDENT><DEDENT>pb.draw()<EOL>a.figure.tight_layout(h_pad=<NUM_LIT>) <EOL>return dict(lines=lines, fills=fills, bg_lines=bg_lines)<EOL>
Plot latent space X in 1D:

    - if fig is given, create input_dim subplots in fig and plot in these
    - if ax is given plot input_dim 1D latent space plots of X into each `axis`
    - if neither fig nor ax is given create a figure with fignum and plot in there

colors:
    colors of different latent space dimensions input_dim