def scatmat(df, category=None, colors='<STR_LIT>',<EOL>num_plots=<NUM_LIT:4>, num_topics=<NUM_LIT:100>, num_columns=<NUM_LIT:4>,<EOL>show=False, block=False, data_path=DATA_PATH, save=False, verbose=<NUM_LIT:1>):
if category is None:<EOL><INDENT>category = list(df.columns)[-<NUM_LIT:1>]<EOL><DEDENT>if isinstance(category, (str, bytes, int)) and category in df.columns:<EOL><INDENT>category = df[category]<EOL><DEDENT>else:<EOL><INDENT>category = pd.Series(category)<EOL><DEDENT>suffix = '<STR_LIT>'.format(*list(df.shape))<EOL>for i in range(min(num_plots * num_columns, num_topics) / num_plots):<EOL><INDENT>scatter_matrix(df[df.columns[i * num_columns:(i + <NUM_LIT:1>) * num_columns]],<EOL>marker='<STR_LIT:+>', c=[colors[int(x) % len(colors)] for x in category.values],<EOL>figsize=(<NUM_LIT>, <NUM_LIT:12>))<EOL><DEDENT>if save:<EOL><INDENT>name = '<STR_LIT>'.format(i * num_columns, (i + <NUM_LIT:1>) * num_columns) + suffix<EOL>plt.savefig(os.path.join(data_path, name + '<STR_LIT>'))<EOL><DEDENT>if show:<EOL><INDENT>if block:<EOL><INDENT>plt.show()<EOL><DEDENT>else:<EOL><INDENT>plt.show(block=False)<EOL><DEDENT><DEDENT>
Scatter plot with colored markers depending on the discrete values in a "category" column

    FIXME: empty plots that dont go away, Plot and/save scatter matrix in groups of num_columns topics