Plot module#
This module enables to explore visually the contents of the databases.
Functions#
- orgmatt.plot.plot_dataframe(df: DataFrame, x: str, y: str, hue: str | None = None, palette: str | None = None, unit: str | None = None, draw_boxes: bool = True, draw_points: bool = True, ax: Axes | None = None, show: bool = False) Axes [source]#
Plot the data contained in a DataFrame as a combination of box and stripplot (individual points).
- Parameters:
df (DataFrame) – The dataframe to plot.
x (str) – Column to use as the x-axis.
y (str) – Column to use as the y-axis.
hue (str, optional (default: None)) – Column to use for column.
palette (str, optional (default: None)) – Palette to use for the colors, see https://seaborn.pydata.org/tutorial/color_palettes.html
unit (str, optional (default: None)) – Unit associated to the y-axis.
draw_boxes (bool, optional (default: True)) – Whether to draw the boxplot.
draw_points (bool, optional (default: True)) – Whether to draw the stripplot with the individual data points.
ax (Axes, optional (default: axis of a new figure)) – The matplotlib axis on which the plot will be drawn.
show (bool, optional (default: True)) – Whether to display the plot immediately.
- Returns:
ax – The matplotlib axis containing the plot.
- Return type:
Axes
- orgmatt.plot.plot_dataset(dataset: str = 'excretions', x: str | None = None, y: str | None = None, hue: str | None = None, palette: str = 'vlag', ax: Axes | list[Axes] | None = None, split_axes: bool = True, show: bool = False, **kwargs) list[Axes] [source]#
Plot the distribution of data in a dataset.
- Parameters:
dataset (str, optional (default: "excretions")) –
x (str, optional (default: deduced from dataset)) – Column to use as the x-axis.
y (str, optional (default: deduced from dataset)) – Column to use as the y-axis.
hue (str, optional (default: x)) – Column to use for column.
palette (str, optional (default: "vlag")) – Palette to use for the colors, see https://seaborn.pydata.org/tutorial/color_palettes.html
ax (Axes, optional (default: axis of a new figure)) – The matplotlib axis on which the plot will be drawn.
split_axes (bool, optional (default: True)) – Whether to create one axis for each unit in the y column.
show (bool, optional (default: True)) – Whether to display the plot immediately.
- Returns:
axes – A list of matplotlib axes containing the plots.
- Return type:
list