def plotcorr(X, plotargs=None, full=True, labels=None):
import matplotlib.pyplot as plt<EOL>X = [Xi._mcpts if isinstance(Xi, UncertainFunction) else Xi for Xi in X]<EOL>X = np.atleast_2d(X)<EOL>numvars, numdata = X.shape<EOL>fig, axes = plt.subplots(nrows=numvars, ncols=numvars, figsize=(<NUM_LIT:8>, <NUM_LIT:8>))<EOL>fig.subplots_adjust(hspace=<NUM_LIT:0.0>, wspace=<NUM_LIT:0.0>)<EOL>for ax in axes.flat:<EOL><INDENT>ax.xaxis.set_visible(False)<EOL>ax.yaxis.set_visible(False)<EOL>if full:<EOL><INDENT>if ax.is_first_col():<EOL><INDENT>ax.yaxis.set_ticks_position("<STR_LIT:left>")<EOL><DEDENT>if ax.is_last_col():<EOL><INDENT>ax.yaxis.set_ticks_position("<STR_LIT:right>")<EOL><DEDENT>if ax.is_first_row():<EOL><INDENT>ax.xaxis.set_ticks_position("<STR_LIT>")<EOL><DEDENT>if ax.is_last_row():<EOL><INDENT>ax.xaxis.set_ticks_position("<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if ax.is_first_row():<EOL><INDENT>ax.xaxis.set_ticks_position("<STR_LIT>")<EOL><DEDENT>if ax.is_last_col():<EOL><INDENT>ax.yaxis.set_ticks_position("<STR_LIT:right>")<EOL><DEDENT><DEDENT><DEDENT>if not labels:<EOL><INDENT>labels = ["<STR_LIT:x>" + str(i) for i in range(numvars)]<EOL><DEDENT>for i, label in enumerate(labels):<EOL><INDENT>axes[i, i].annotate(<EOL>label, (<NUM_LIT:0.5>, <NUM_LIT:0.5>), xycoords="<STR_LIT>", ha="<STR_LIT>", va="<STR_LIT>"<EOL>)<EOL><DEDENT>for i, j in zip(*np.triu_indices_from(axes, k=<NUM_LIT:1>)):<EOL><INDENT>if full:<EOL><INDENT>idx = [(i, j), (j, i)]<EOL><DEDENT>else:<EOL><INDENT>idx = [(i, j)]<EOL><DEDENT>for x, y in idx:<EOL><INDENT>if plotargs is None:<EOL><INDENT>if len(X[x]) > <NUM_LIT:100>:<EOL><INDENT>plotargs = "<STR_LIT>"  <EOL><DEDENT>else:<EOL><INDENT>plotargs = "<STR_LIT>"  <EOL><DEDENT><DEDENT>axes[x, y].plot(X[y], X[x], plotargs)<EOL>ylim = min(X[y]), max(X[y])<EOL>xlim = min(X[x]), max(X[x])<EOL>axes[x, y].set_ylim(<EOL>xlim[<NUM_LIT:0>] - (xlim[<NUM_LIT:1>] - xlim[<NUM_LIT:0>]) * <NUM_LIT:0.1>, xlim[<NUM_LIT:1>] + (xlim[<NUM_LIT:1>] - xlim[<NUM_LIT:0>]) * <NUM_LIT:0.1><EOL>)<EOL>axes[x, y].set_xlim(<EOL>ylim[<NUM_LIT:0>] - (ylim[<NUM_LIT:1>] - ylim[<NUM_LIT:0>]) * <NUM_LIT:0.1>, ylim[<NUM_LIT:1>] + (ylim[<NUM_LIT:1>] - ylim[<NUM_LIT:0>]) * <NUM_LIT:0.1><EOL>)<EOL><DEDENT><DEDENT>if full:<EOL><INDENT>for i, j in zip(list(range(numvars)), itertools.cycle((-<NUM_LIT:1>, <NUM_LIT:0>))):<EOL><INDENT>axes[j, i].xaxis.set_visible(True)<EOL>axes[i, j].yaxis.set_visible(True)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for i in range(numvars - <NUM_LIT:1>):<EOL><INDENT>axes[<NUM_LIT:0>, i + <NUM_LIT:1>].xaxis.set_visible(True)<EOL>axes[i, -<NUM_LIT:1>].yaxis.set_visible(True)<EOL><DEDENT>for i in range(<NUM_LIT:1>, numvars):<EOL><INDENT>for j in range(<NUM_LIT:0>, i):<EOL><INDENT>fig.delaxes(axes[i, j])<EOL><DEDENT><DEDENT><DEDENT>if numvars % <NUM_LIT:2>:<EOL><INDENT>xlimits = axes[<NUM_LIT:0>, -<NUM_LIT:1>].get_xlim()<EOL>ylimits = axes[-<NUM_LIT:1>, <NUM_LIT:0>].get_ylim()<EOL>axes[-<NUM_LIT:1>, -<NUM_LIT:1>].set_xlim(xlimits)<EOL>axes[-<NUM_LIT:1>, -<NUM_LIT:1>].set_ylim(ylimits)<EOL><DEDENT>return fig<EOL>
Plots a scatterplot matrix of subplots.  

Usage:

    plotcorr(X)

    plotcorr(..., plotargs=...)  # e.g., 'r*', 'bo', etc.

    plotcorr(..., full=...)  # e.g., True or False

    plotcorr(..., labels=...)  # e.g., ['label1', 'label2', ...]

Each column of "X" is plotted against other columns, resulting in
a ncols by ncols grid of subplots with the diagonal subplots labeled 
with "labels".  "X" is an array of arrays (i.e., a 2d matrix), a 1d array
of MCERP.UncertainFunction/Variable objects, or a mixture of the two.
Additional keyword arguments are passed on to matplotlib's "plot" command. 
Returns the matplotlib figure object containing the subplot grid.