slitflow.fig.bar module

class Simple(info_path=None)[source]

Bases: Figure

Bar graph with or without error bar.

Parameters:
  • reqs[0] (Table) – Table containing X and Y axes to create figure.

  • param["calc_cols"] (list of str) – Column names for X and Y axes.

  • param["bar_widths"] (float or list of float, optional) – Width of each bar. Defaults to 0.8.

  • param["err_col"] (str, optional) – Column name for error bar.

  • param["cap_size"] (float, optional) – Cap size of error bar.

  • param["group_depth"] (int) – Data split depth number.

Returns:

Bar Figure object

Return type:

Figure

set_info(param={})[source]

Copy info from reqs[0] and add params.

static process(reqs, param)[source]

Bar graph with or without error bar.

Parameters:
  • reqs[0] (pandas.DataFrame) – Table containing X and Y axes to create figure.

  • param["calc_cols"] (list of str) – Column names for X and Y axes.

  • param["bar_widths"] (float or list of float) – Width of each bar.

  • param["err_col"] (str, optional) – Column name for error bar.

  • param["cap_size"] (float) – Cap size of error bar.

  • param["index_cols"] (list of str) – Column names of index. These column names are used for pandas.DataFrame.groupby().

Returns:

matplotlib Figure containing bar plot

Return type:

matplotlib.figure.Figure

class WithModel(info_path=None)[source]

Bases: Figure

Bar graph with or without error bar and with model curves.

Parameters:
  • reqs[0] (Table) – Table containing X and Y axes of raw data.

  • reqs[1] (Table) – Table containing X and Y axes of model curve.

  • param["calc_cols"] (list of str) – Column names for X and Y axes.

  • param["err_col"] (str, optional) – Column name for error bar.

  • param["model_cols"] (list of str) – Column names for X and Y axes of model curves.

  • param["cap_size"] (float, optional) – Cap size of error bar. Required if “err_col” in param. Defaults to 2.

  • param["group_depth"] (int) – Data split depth number.

  • param["group_depth_model"] (int) – Depth number to split model data.

Returns:

Bar Figure object with error and model

Return type:

Figure

set_info(param={})[source]

Convert input information to Info object.

This method creates columns and parameters information. The columns information is used to handle data structure. The parameter dictionaries are set as param of process(). This method is called before run(). Implemented in subclass.

Parameters:

param (dict, optional) – Parameters for columns or params.

static process(reqs, param)[source]

Bar graph with or without error bar and with model curves.

Parameters:
  • reqs[0] (pandas.DataFrame) – Table containing X and Y axes to create figure.

  • param["calc_cols"] (list of str) – Column names for X and Y axes.

  • param["err_col"] (str, optional) – Column name for error bar.

  • param["model_cols"] (list of str) – Column names for X and Y axes of model curves.

  • param["index_cols"] (list of str) – Column names of index. This column is used for pandas.DataFrame.groupby().

  • param["cap_size"] (float, optional) – Cap size of error bar. Required if “err_col” in param.

  • param["index_cols_model"] (list of str) – Column names of index. This column is used for pandas.DataFrame.groupby() of model.

Returns:

matplotlib Figure containing bar plot with model

Return type:

matplotlib.figure.Figure