MD_plotting_toolkit.data_processing

MD_plotting_toolkit.plotting_utils

The plotting_utils module provides various utilities for plotting.

MD_plotting_toolkit.plotting_utils.default_settings(font='Arial')[source]

This function adopts the plotting settings shown below.

MD_plotting_toolkit.plotting_utils.get_bars_locations(n_bars, n_groups, width)[source]

Gets the locations of all the bars in a grouped bar chart.

Parameters:
  • n_bars (int) – The number of bars in each group.

  • n_groups (int) – The total number of groups of bars.

  • width (float) – The width of one bar.

Returns:

bar_locs – An array of lists containing bar locations for the bars in each group. For example, if n_groups = 5, this would be an array of 5 lists.

Return type:

np.array

MD_plotting_toolkit.plotting_utils.get_fig_dimension(n_subplots)[source]

Gets the number of plots in each row/column given the total number of subplots. The dimensions will be as close as to a square as possible.

Parameters:

n_subplots (int) (The number of subplots.)

Returns:

  • n_rows (int) (The number of rows in the figure.)

  • n_cols (int) (The number of columns in the figure.)

MD_plotting_toolkit.plotting_utils.identify_var_units(label)[source]

This function parses the x-label or y-label to figure out the variable name and unit if possible.

Parameters:

label (str) – The label of x- or y-axis.

Returns:

  • var (str) – The name of the variable.

  • unit (str) – The units of the variable.

MD_plotting_toolkit.utils

The utils module provides various general utilities.

exception MD_plotting_toolkit.utils.InputFileError[source]

An error indicating that the input file was not properly specified.

exception MD_plotting_toolkit.utils.ParameterError[source]

An error due to improperly specified parameters has been deteced.