uadapy.plotting package
Submodules
uadapy.plotting.distribution_plot module
- class uadapy.plotting.distribution_plot.InteractiveNormal(mean: ndarray, cov: ndarray, ax: Axes, n_std: float = 1.0, extends: float = 10, epsilon: float = 10, x_label: str = '', y_label: str = '')
Bases:
object
- get_ind_under_point(event)
get the index of the vertex under point if within epsilon tolerance
- init_points()
- update(plot_int: bool = False)
- uadapy.plotting.distribution_plot.confidence_ellipse(mean: ndarray, cov: ndarray, ax: Axes, n_std: float = 3.0, facecolor='blue', **kwargs)
Create a plot of the covariance confidence ellipse of x and y.
- Parameters:
ax (matplotlib.axes.Axes) – The axes object to draw the ellipse into.
n_std (float) – The number of standard deviations to determine the ellipse’s radiuses.
**kwargs – Forwarded to ~matplotlib.patches.Ellipse
- Return type:
matplotlib.patches.Ellipse
uadapy.plotting.interactive_splom module
uadapy.plotting.plots2D module
- uadapy.plotting.plots2D.generate_random_colors(length)
- uadapy.plotting.plots2D.generate_spectrum_colors(length)
- uadapy.plotting.plots2D.plot_contour(distributions, resolution=128, ranges=None, quantiles: list | None = None, seed=55, **kwargs)
Plot contour plots for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
resolution (int, optional) – The resolution of the plot. Default is 128.
ranges (list or None, optional) – The ranges for the x and y axes. If None, the ranges are calculated based on the distributions.
quantiles (list or None, optional) – List of quantiles to use for determining isovalues. If None, the 99.7%, 95%, and 68% quantiles are used.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
**kwargs (additional keyword arguments) –
Additional optional plotting arguments. - 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.
- Raises:
ValueError – If a quantile is not between 0 and 100 (exclusive), or if a quantile results in an index that is out of bounds.
- uadapy.plotting.plots2D.plot_contour_bands(distributions, n_samples, resolution=128, ranges=None, quantiles: list | None = None, seed=55, **kwargs)
Plot contour bands for samples drawn from given distributions.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int) – Number of samples per distribution.
resolution (int, optional) – The resolution of the plot. Default is 128.
ranges (list or None, optional) – The ranges for the x and y axes. If None, the ranges are calculated based on the distributions.
quantiles (list or None, optional) – List of quantiles to use for determining isovalues. If None, the 99.7%, 95%, and 68% quantiles are used.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
**kwargs (additional keyword arguments) –
Additional optional plotting arguments. - 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.
- Raises:
ValueError – If a quantile is not between 0 and 100 (exclusive), or if a quantile results in an index that is out of bounds.
- uadapy.plotting.plots2D.plot_samples(distributions, n_samples, seed=55, **kwargs)
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.
**kwargs (additional keyword arguments) –
Additional optional plotting arguments. - xlabel : string, optional
label for x-axis.
- ylabelstring, optional
label for y-axis.
- show_plotbool, 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.
uadapy.plotting.plotsND module
- uadapy.plotting.plotsND.plot_contour(distributions, n_samples, resolution=128, ranges=None, quantiles: list | None = None, seed=55, **kwargs)
Visualizes a multidimensional distribution in a matrix of contour plots.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int) – Number of samples per distribution.
resolution (int, optional) – The resolution for the pdf. Default is 128.
ranges (list or None, optional) – Array of ranges for all dimensions. If None, the ranges are calculated based on the distributions.
quantiles (list or None, optional) – List of quantiles to use for determining isovalues. If None, the 99.7%, 95%, and 68% quantiles are used.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
**kwargs (additional keyword arguments) –
Additional optional plotting arguments. - 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.
- Raises:
ValueError – If a quantile is not between 0 and 100 (exclusive), or if a quantile results in an index that is out of bounds.
Exception – If the dimension of the distribution is less than 2.
- uadapy.plotting.plotsND.plot_contour_samples(distributions, n_samples, resolution=128, ranges=None, quantiles: list | None = None, seed=55, **kwargs)
Visualizes a multidimensional distribution in a matrix visualization where the upper diagonal contains contour plots and the lower diagonal contains scatterplots.
- Parameters:
distributions (list) – List of distributions to plot.
n_samples (int) – Number of samples for the scatterplot.
resolution (int, optional) – The resolution for the pdf. Default is 128.
ranges (list or None, optional) – Array of ranges for all dimensions. If None, the ranges are calculated based on the distributions.
quantiles (list or None, optional) – List of quantiles to use for determining isovalues. If None, the 99.7%, 95%, and 68% quantiles are used.
seed (int) – Seed for the random number generator for reproducibility. It defaults to 55 if not provided.
**kwargs (additional keyword arguments) –
Additional optional plotting arguments. - 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.
- Raises:
ValueError – If a quantile is not between 0 and 100 (exclusive), or if a quantile results in an index that is out of bounds.
Exception – If the dimension of the distribution is less than 2.
- uadapy.plotting.plotsND.plot_samples(distributions, n_samples, seed=55, **kwargs)
Plot samples from the multivariate distribution as a SLOM.
- 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.
**kwargs (additional keyword arguments) –
Additional optional plotting arguments. - 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.
uadapy.plotting.utils module
- uadapy.plotting.utils.generate_random_colors(n)
- uadapy.plotting.utils.generate_spectrum_colors(n)