uadapy.plotting.plots_1d module
- uadapy.plotting.plots_1d.generate_boxplot(distributions, n_samples=10000, seed=55, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, **kwargs)
Plot box plot for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 10000.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
**kwargs (additional matplotlib.pyplot.boxplot keyword arguments) – Additional optional plotting arguments.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.generate_dotplot(distributions, n_samples=20, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, dot_size=0)
Plot dot plot for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 20.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
dot_size (float, optional) – This parameter determines the size of the dots. If not provided, the size is calculated based on the number of samples and the type of plot.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.generate_multidim_boxplot(distributions, n_samples=10000, seed=55, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, **kwargs)
Plot multidimensional box plots for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 10000.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
**kwargs (additional matplotlib.pyplot.boxplot keyword arguments) – Additional optional plotting arguments.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.generate_multidim_dotplot(distributions, n_samples=20, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, dot_size=0)
Plot multidimensional dot plots for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 20.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
dot_size (float, optional) – This parameter determines the size of the dots. If not provided, the size is calculated based on the number of samples and the type of plot.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.generate_multidim_stripplot(distributions, n_samples=20, seed=55, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, dot_size=0)
Plot multidimensional strip plots for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 20.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
dot_size (float, optional) – This parameter determines the size of the dots. If not provided, the size is calculated based on the number of samples and the type of plot.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.generate_multidim_swarmplot(distributions, n_samples=20, seed=55, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, dot_size=0)
Plot multidimensional swarm plots for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 20.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
dot_size (float, optional) – This parameter determines the size of the dots. If not provided, the size is calculated based on the number of samples and the type of plot.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.generate_multidim_violinplot(distributions, n_samples=10000, seed=55, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, **kwargs)
Plot multidimensional violin plots for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 10000.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
**kwargs (additional matplotlib.pyplot.violinplot keyword arguments) – Additional optional plotting arguments.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.generate_stripplot(distributions, n_samples=20, seed=55, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, dot_size=0)
Plot strip plot for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 20.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
dot_size (float, optional) – This parameter determines the size of the dots. If not provided, the size is calculated based on the number of samples and the type of plot.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.generate_swarmplot(distributions, n_samples=20, seed=55, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, dot_size=0)
Plot swarm plot for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 20.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
dot_size (float, optional) – This parameter determines the size of the dots. If not provided, the size is calculated based on the number of samples and the type of plot.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.generate_violinplot(distributions, n_samples=10000, seed=55, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, **kwargs)
Plot violin plot for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int, optional) – Number of samples per distribution. Default is 10000.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
**kwargs (additional matplotlib.pyplot.violinplot keyword arguments) – Additional optional plotting arguments.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.
- uadapy.plotting.plots_1d.plot_1d_distribution(distributions, n_samples, plot_types: list, seed=55, fig=None, axs=None, distrib_labels=None, dim_labels=None, distrib_colors=None, vert=True, colorblind_safe=False, show_plot=False, dot_size=0, restrict_to_1d=True, **kwargs)
Plot box plots, violin plots and dot plots for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int) – Number of samples per distribution.
plot_types (list) – List of plot types to plot. Valid values are ‘boxplot’,’violinplot’, ‘stripplot’, ‘swarmplot’ and ‘dotplot’.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
fig (matplotlib.figure.Figure or None, optional) – Figure object to use for plotting. If None, a new figure will be created.
axs (matplotlib.axes.Axes or array of Axes or None, optional) – Axes object(s) to use for plotting. If None, new axes will be created.
distrib_labels (list or None, optional) – Labels for each distribution.
dim_labels (list or None, optional) – Titles for each subplot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
vert (bool, optional) – If True, plots will be drawn vertically. If False, plots will be drawn horizontally. Default is True.
colorblind_safe (bool, optional) – If True, the plot will use colors suitable for colorblind individuals. Default is False.
show_plot (bool, optional) – If True, display the plot. Default is False.
dot_size (float, optional) – This parameter determines the size of the dots used in the ‘stripplot’,’swarmplot’ and ‘dotplot’. If not provided, the size is calculated based on the number of samples and the type of plot.
restrict_to_1d (bool, optional) – If True, restricts the function to generate boxplots only for 1-dimensional distributions. An error is raised for multidimensional distributions. Default is True.
**kwargs (additional matplotlib keyword arguments) – Additional optional plotting arguments.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.