uadapy.plotting.plots_2d module
- uadapy.plotting.plots_2d.plot_contour(distributions, resolution=128, ranges=None, quantiles=[25, 75, 95], fig=None, axs=None, distrib_colors=None, colorblind_safe=False, show_plot=False)
Plot contour plots for given distributions.
- Parameters:
distributions (Distribution or list of Distribution) – Distribution(s) to plot.
resolution (int, optional) – The resolution of the plot. Default is 128.
ranges (list of tuple or None, optional) – The ranges for the x and y axes as [(x_min, x_max), (y_min, y_max)]. If None, ranges are calculated based on the distributions.
quantiles (list of float or None, optional) – List of quantiles to use for determining isovalues. Default is [25, 75, 95].
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 None, optional) – Axes object to use for plotting. If None, new axes will be created.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
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.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
matplotlib.axes.Axes – The axes object used for plotting.
- Raises:
ValueError – If a quantile is not between 0 and 100 (exclusive).
- uadapy.plotting.plots_2d.plot_contour_bands(distributions, resolution=128, ranges=None, quantiles=[25, 75, 95], fig=None, axs=None, show_plot=False)
Plot contour bands for given distributions.
- Parameters:
distributions (Distribution or list of Distribution) – Distribution(s) to plot.
resolution (int, optional) – The resolution of the plot. Default is 128.
ranges (list of tuple or None, optional) – The ranges for the x and y axes as [(x_min, x_max), (y_min, y_max)]. If None, ranges are calculated based on the distributions.
quantiles (list of float or None, optional) – List of quantiles to use for determining isovalues. Default is [25, 75, 95].
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 None, optional) – Axes object to use for plotting. If None, new axes will be created.
show_plot (bool, optional) – If True, display the plot. Default is False.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
matplotlib.axes.Axes – The axes object used for plotting.
- Raises:
ValueError – If a quantile is not between 0 and 100 (exclusive).
- uadapy.plotting.plots_2d.plot_samples(distributions, n_samples, seed=55, point_size=None, fig=None, axs=None, x_label=None, y_label=None, title=None, distrib_colors=None, colorblind_safe=False, show_plot=False)
Plot samples from the given distribution. If several distributions should be plotted together, an array can be passed to this function.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int) – Number of samples per distribution.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
point_size (float or None, optional) – Marker size (area in points^2). If None, matplotlib’s default is used.
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 None, optional) – Axes object to use for plotting. If None, new axes will be created.
x_label (string, optional) – label for x-axis.
y_label (string, optional) – label for y-axis.
title (string, optional) – title for the plot.
distrib_colors (list or None, optional) – List of colors to use for each distribution. If None, Matplotlib Set2 and glasbey colors will be used.
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.
- Returns:
matplotlib.figure.Figure – The figure object containing the plot.
list – List of Axes objects used for plotting.