autoemx.core.composition_analysis.clustering_plot_axes module
Shared axis formatting helpers for composition clustering plots.
- autoemx.core.composition_analysis.clustering_plot_axes.clamp_composition_axis_limits(ax: Any, *, is_3d: bool = False) None[source]
Clamp all composition axes to [0, 1], preserving reversed display order.
- autoemx.core.composition_analysis.clustering_plot_axes.composition_axis_ticks(lo: float, hi: float, *, nbins: int = 6) ndarray[source]
Return non-negative tick positions for a composition axis segment.
- autoemx.core.composition_analysis.clustering_plot_axes.compute_zoom_limits(values: ndarray, margin_ratio: float = 0.08, min_span: float = 0.1, central_fraction: float = 0.9) tuple[float, float][source]
Return axis limits that frame the central fraction of sample values.
- autoemx.core.composition_analysis.clustering_plot_axes.expand_limits(low: float, high: float, margin_ratio: float = 0.2) tuple[float, float][source]
Expand axis limits by a fraction of their span, clamped to [0, 1].
- autoemx.core.composition_analysis.clustering_plot_axes.int_percent_formatter() FuncFormatter[source]
Format fractional composition values as integer percentages.
- autoemx.core.composition_analysis.clustering_plot_axes.apply_dynamic_axis_formatting(ax: Any, *, is_3d: bool = False, nbins: int = 6) None[source]
Install self-updating tick locators/formatters for the composition axes.
The locator recomputes tick positions from the current view limits on every draw (e.g. after an interactive pan/zoom/rotate) and always clamps them to [0, 1], so labels never appear outside the 0-100% range, while the view itself remains free to zoom/pan without limit.
- autoemx.core.composition_analysis.clustering_plot_axes.apply_fixed_full_range_ticks(ax: Any, *, is_3d: bool = False) None[source]
Use fixed 10%-step ticks for the full 0-100% composition range.
- autoemx.core.composition_analysis.clustering_plot_axes.gather_clustering_zoom_points(els_comps_list: ndarray, centroids: ndarray, unused_compositions_list: Sequence, elements: List[str], ref_phases_df: Any | None = None) ndarray[source]
Collect points used to compute data-driven clustering plot axis limits.
- autoemx.core.composition_analysis.clustering_plot_axes.point_within_composition_limits(point: Sequence[float], xlim: tuple[float, float], ylim: tuple[float, float], zlim: tuple[float, float] | None = None) bool[source]
Return True when a composition-space point lies inside the given axis limits.
- autoemx.core.composition_analysis.clustering_plot_axes.compute_data_driven_axis_limits(all_points: ndarray, *, is_3d: bool = False, margin_ratio: float = 0.2, min_span_fraction: float = 0.01) tuple[tuple[float, float], tuple[float, float], tuple[float, float] | None][source]
Return data-driven composition axis limits for clustering zoom plots.