wellmap.show_df

wellmap.show_df(df, cols=None, *, style=None)[source]

Visualize the microplate layout described by the given data frame.

Unlike the show() function and the wellmap command-line program, this function is not limited to displaying layouts parsed directly from TOML files. Any data frame that specifies a well for each row can be plotted. This provides the means to:

  • Project experimental data onto a layout.

  • Visualize layouts that weren’t generated by wellmap in the first place.

For example, you could load experimental data into a data frame and use this function to visualize it directly, without ever having to specify a layout. This might be a useful way to get a quick sense for the data.

Parameters:
  • df (pandas.DataFrame) –

    The data frame describing the layout to plot. The data frame must be tidy: each row must describe a single well, and each column must describe a single aspect of each well. The location of each well must be specified using one or more of the same columns that wellmap uses for that purpose, namely:

    • plate

    • well

    • well0

    • row

    • col

    • row_i

    • col_j

    See load() for the exact meanings of these columns. It’s not necessary to specify all of these columns, there just needs to be enough information to locate each well. If the plate column is missing, it is assumed that all of the wells are on the same plate. It is also assumed that any redundant columns (e.g. row and row_i) will be consistent with each other.

    Any scalar-valued columns other than these can be plotted.

  • cols (str,list) – Which columns to plot onto the layout. The columns used to locate the wells (listed above) cannot be plotted. The default is to include any columns that have at least two different values.

  • style (Style) – Settings than control miscellaneous aspects of the plot, e.g. colors, dimensions, etc.

Return type:

matplotlib.figure.Figure