uvisbox.Modules.FunctionalBoxplot.functional_boxplot_vis ======================================================== .. py:module:: uvisbox.Modules.FunctionalBoxplot.functional_boxplot_vis Module Contents --------------- .. py:function:: plot_band(bottom_curve, top_curve, vmin=0, vmax=1, ax=None, color='red', alpha=1.0, scale=1.0) Plot a functional band envelope between bottom and top curves. This function creates a filled area between the curves using matplotlib's fill_between. :param bottom_curve: 1D array representing the bottom boundary of the band. :type bottom_curve: np.ndarray :param top_curve: 1D array representing the top boundary of the band. :type top_curve: np.ndarray :param ax: Matplotlib axes to plot on. If None, creates new figure with axes. :type ax: matplotlib.axes.Axes, optional :param color: Color for the band. Default is 'red'. Can be any matplotlib color specification (named color, hex, RGB tuple, etc.). :type color: str or tuple, optional :param alpha: Transparency of the band (0=transparent, 1=opaque). Default is 1.0. :type alpha: float, optional :param scale: Scale factor for the curves. Default is 1.0. :type scale: float, optional :returns: **ax** -- The matplotlib axes object used for plotting. :rtype: matplotlib.axes.Axes :raises ValueError: If bottom_curve and top_curve have different shapes. .. rubric:: Examples >>> import numpy as np >>> import matplotlib.pyplot as plt >>> from uvisbox.Modules.FunctionalBoxplot import plot_band >>> from uvisbox.Modules.FunctionalBoxplot.functional_boxplot_stats import functional_boxplot_get_band >>> >>> # Generate synthetic data >>> data = np.random.randn(100, 50).cumsum(axis=1) >>> >>> # Get 50th percentile band >>> bottom, top = functional_boxplot_get_band(data, 50, method='fbd') >>> >>> # Plot the band >>> fig, ax = plt.subplots() >>> plot_band(bottom, top, ax=ax, color='blue', alpha=0.5) >>> plt.show() .. py:function:: visualize_functional_boxplot(mesh_data, vmin=0, vmax=1, boxplot_style=None, ax=None) Visualize functional boxplot from mesh data (summary statistics). This function creates a matplotlib visualization of the functional boxplot using the summary statistics output from the stats/mesh pipeline. :param mesh_data: Dictionary containing summary statistics with the following keys: - 'percentile_bands': dict of percentile bands - 'median': median curve - 'outliers': outlier curves - 'sorted_curves': all curves sorted by depth :type mesh_data: dict :param boxplot_style: Configuration for the boxplot visualization including percentiles, colormap, and median/outlier styling. If None, uses default configuration. :type boxplot_style: BoxplotStyleConfig, optional :param ax: Matplotlib axes to plot on. If None, creates a new figure. :type ax: matplotlib.axes.Axes, optional :returns: **ax** -- The matplotlib axes object with the plot. :rtype: matplotlib.axes.Axes .. rubric:: Examples >>> import numpy as np >>> from uvisbox.Modules.FunctionalBoxplot.functional_boxplot_stats import functional_boxplot_summary_statistics >>> from uvisbox.Modules.FunctionalBoxplot.functional_boxplot_mesh import functional_boxplot_mesh >>> from uvisbox.Modules.FunctionalBoxplot.functional_boxplot_vis import visualize_functional_boxplot >>> from uvisbox.Core.CommonInterface import BoxplotStyleConfig >>> >>> # Generate synthetic functional data >>> t = np.linspace(0, 1, 100) >>> data = np.array([np.sin(2*np.pi*t) + 0.2*np.random.randn(100) for _ in range(50)]) >>> >>> # Process through pipeline >>> stats = functional_boxplot_summary_statistics(data) >>> mesh_data = functional_boxplot_mesh(stats) >>> >>> # Visualize >>> ax = visualize_functional_boxplot(mesh_data) >>> >>> # Custom styling >>> style = BoxplotStyleConfig(percentiles=[25, 50, 75, 90], show_outliers=True) >>> ax = visualize_functional_boxplot(mesh_data, boxplot_style=style)