shnitsel.vis.plot.kde ===================== .. py:module:: shnitsel.vis.plot.kde Functions --------- .. autoapisummary:: shnitsel.vis.plot.kde.fit_kdes shnitsel.vis.plot.kde.eval_kdes shnitsel.vis.plot.kde.get_xx_yy shnitsel.vis.plot.kde.fit_and_eval_kdes shnitsel.vis.plot.kde.plot_kdes shnitsel.vis.plot.kde.biplot_kde shnitsel.vis.plot.kde.plot_cdf_for_kde Module Contents --------------- .. py:function:: fit_kdes(noodle, geo_prop, geo_filter) .. py:function:: eval_kdes(kernels, xx, yy) .. py:function:: get_xx_yy(noodle, fineness=500, extension=0.1) .. py:function:: fit_and_eval_kdes(noodle, geo_prop, geo_filter, fineness=500, extension=0.1) .. py:function:: plot_kdes(xx, yy, Zs, colors=None, levels=None, fill=True, fig=None, ax=None) .. py:function:: biplot_kde(frames, at1 = 0, at2 = 1, at3 = None, at4 = None, geo_filter = None, levels = None, scatter_color = 'time', fill = True, nbins=4, mean=False) Generates a biplot that visualizes PCA projections and kernel density estimates (KDE) of a property (distance, angle, dihedral angle) describing the geometry of specified atoms. The property is chosen based on the number of atoms specified: * 2 atoms => distance * 3 atoms => angle * 4 atoms => dihedral angle :param frames: A dataset containing trajectory frames with atomic coordinates. :param at1: Indices of the first, second, third and fourth atoms for geometric property calculation. :param at2: Indices of the first, second, third and fourth atoms for geometric property calculation. :param at3: Indices of the first, second, third and fourth atoms for geometric property calculation. :param at4: Indices of the first, second, third and fourth atoms for geometric property calculation. :param geo_filter: A list of tuples representing ranges. A KDE is plotted for each range, indicating the distribution of points for which the value of the geometry feature falls in that range. :param levels: Contour levels for the KDE plot. Defaults to [0.08, 1]. This parameter is passed to matplotlib.axes.Axes.contour. :param scatter_color: Must be one of 'time' or 'geo'. If 'time', the scatter-points will be colored based on the time coordinate; if 'geo', the scatter-points will be colored based on the relevant geometry feature (see above). :param fill: Whether to plot filled contours (``fill=True``, uses ``ax.contourf``) or just contour lines (``fill=False``, uses ``ax.contour``). :param nbins: number of bins to be visualized, must be an integer between 1 and 4 :returns: The computed KDE data for the atom-atom distance distribution. :rtype: kde_dat .. rubric:: Notes * Computes a geometric property of the specified atoms across all frames. * Uses kernel density estimation (KDE) to analyze the distance distributions. * Performs PCA on trajectory pairwise distances and visualizes clustering of structural changes. * Produces a figure with PCA projection, cluster analysis, and KDE plots. .. py:function:: plot_cdf_for_kde(z, level, ax=None)