wholecell.utils.plotting_tools

Reusable plotting functions and tools

wholecell.utils.plotting_tools.export_figure(plt, plotOutDir, plotOutFileName, metadata=None, transparent=False, dpi=120, extension=None)[source]
wholecell.utils.plotting_tools.heatmap(ax, mask, data, completion_data, xticklabels, yticklabels, xlabel='', ylabel='', title='', box_text_size='medium', ax_font_size=9, title_font_size=9, percent_completion_threshold=0.88)[source]
Parameters:
  • ax – Axes object

  • mask – Only plot values where mask is true, must match dimensions of

  • data

  • data – 2-dimensional numpy array of data to plot

  • completion_data – Percent of seeds that successfully completed all

  • value (generations that contributed to this)

  • of (must match dimensions)

  • data

  • xticklabels – tick values for x-axis

  • yticklabels – tick values for y-axis

  • xlabel – x-axis label for plot

  • ylabel – y-axis label for plot

  • title – plot title

  • box_text_size – size of text value to be printed in box

  • ax_font_size – font size for labeling axes

  • title_font_size – font size for title

  • percent_completion_threshold – If the percent completion for this

  • threshold (parameter combination is lower than the)

  • the (the number in)

  • 0 (box will be colored red. If the threshold is)

  • be (no numbers will)

  • red. (colored)

Returns:

heatmap of data, where squares are colored by value and numbers are colored by the percent of simulations that successfuly completed, for data corresponding to different parameter values in 2 dimensions

wholecell.utils.plotting_tools.labeled_indexable_hist(ax, data, gen_data, gen_start, gen_end, colors, xlabel, bin_width=1.0, xlim=None, sf=1, font_size=9)[source]

Creates a histogram of (subset of) data, with label for mean and standard deviation of data for each variant

Parameters:
  • ax – Axes object

  • data – data to plot

  • gen_data – generation index corresponding to each data point

  • gen_start – index of generation to start from (inclusive)

  • gen_end – index of generation to end at (exclusive)

  • colors – list of colors to use for each variant

  • xlabel – x-axis label for plot

  • bin_width – used in conjunction with xlim to determine number of bins

  • xlim – specify x-axis plotting region

  • sf – scale factor

  • font_size – font size for labeling axes

Returns:

histogram of data, colored by variant, for data corresponding to

generation indexes in [gen_start:gen_end]

wholecell.utils.plotting_tools.labeled_indexable_scatter(ax, xdata, ydata, gen_data, gen_start, gen_end, colors, xlabel, ylabel, xlim=None, ylim=None, sf=1, font_size=9)[source]

Creates a scatterplot of (subset of) data, with label for mean and standard deviation of data for each variant

Parameters:
  • ax – Axes object

  • xdata – data to plot on x axes

  • ydata – data to plot on y axes

  • gen_data – generation index corresponding to each data point

  • gen_start – index of generation to start from (inclusive)

  • gen_end – index of generation to end at (exclusive)

  • colors – list of colors to use for each variant

  • xlabel – x-axis label for plot

  • ylabel – y-axis label for plot

  • xlim – specify x-axis plotting region

  • ylim – specify y-axis plotting region

  • sf – scale factor

  • font_size – font size for labeling axes

Returns:

scatterplot of data, colored by variant, for data corresponding

to generation indexes in [gen_start:gen_end]

wholecell.utils.plotting_tools.plot_splom(arrayOfdataArrays, nameArray='', stdArrays=None, labels=None, fig=None, plotCorrCoef=True, formatString='o')[source]

Plot a scatterplot matrix (Splom) of data contained in arrayOfdataArrays, with labels in the same order held within nameArray.

wholecell.utils.plotting_tools.remove_border(ax=None, bottom=False)[source]