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
A class for interactive visualization of a bivariate normal distribution.
- mean
Mean vector of the normal distribution.
- Type:
np.ndarray
- cov
Covariance matrix.
- Type:
np.ndarray
- ax
The axes object where the distribution is plotted.
- Type:
matplotlib.axes.Axes
- n_std
The number of standard deviations for the confidence ellipse. Default is 1.0.
- Type:
float, optional
- extends
Extension factor for the plot limits. Default is 10.
- Type:
float, optional
- epsilon
Selection tolerance for interactive manipulation. Default is 10.
- Type:
float, optional
- x_label
Label for the x-axis.
- Type:
str, optional
- y_label
Label for the y-axis.
- Type:
str, optional
- points
Eigenvector points for visualization.
- Type:
np.ndarray
- eigenvectors
Eigenvectors computed from the covariance matrix.
- Type:
np.ndarray
- get_ind_under_point(event)
Returns the index of the point under the given event coordinates.
- Parameters:
event (matplotlib.backend_bases.MouseEvent) – Mouse event with x and y coordinates.
- Returns:
Index of the closest point within the tolerance, or None if no point is close enough.
- Return type:
int or None
- init_points()
Computes eigenvectors and eigenvalues of the covariance matrix and initializes points for visualization.
- update(plot_int: bool = False)
Updates the plot with the confidence ellipse and eigenvector lines.
- Parameters:
plot_int (bool, optional) – Whether to plot eigenvectors and key points interactively (default: 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:
mean (np.ndarray) – Mean vector of the distribution.
cov (np.ndarray) – Covariance matrix.
ax (matplotlib.axes.Axes) – The axes object to draw the ellipse into.
n_std (float, optional) – The number of standard deviations to determine the ellipse’s radiuses. Default is 3.0.
facecolor (str, optional) – The fill color of the ellipse. Default is ‘blue’.
**kwargs (additional matplotlib.patches.Ellipse keyword arguments) – Additional optional plotting arguments.
- Returns:
The confidence ellipse patch added to the axis.
- Return type:
matplotlib.patches.Ellipse
uadapy.plotting.interactive_splom module
uadapy.plotting.plots2D module
uadapy.plotting.plotsND module
uadapy.plotting.utils module
- uadapy.plotting.utils.create_shaded_set2_colormap(alpha_values)
Create a custom colormap by varying alpha values for each Set2 color.
Parameters: - alpha_values: list or array of alpha values to apply to each Set2 color (e.g., [0.3, 0.6, 1]).
Returns: - A custom colormap with 8 Set2 colors, each with 3 alpha variations (total of 24 colors).
- uadapy.plotting.utils.generate_random_colors(n)
- uadapy.plotting.utils.generate_spectrum_colors(n)
- uadapy.plotting.utils.get_colors(n)