massdash.plotting.InteractiveTwoDimensionPlotter
- class massdash.plotting.InteractiveTwoDimensionPlotter(config: PlotConfig)
Bases:
objectA class for interactive two-dimensional plotting.
- df
The input DataFrame containing the data for plotting.
- Type:
pd.DataFrame
- config
The configuration for plotting.
- Type:
- create_heatmap_plot(title_text: str, arr: ndarray, rt_min: float, rt_max: float, im_min: float, im_max: float, dw_main: float, dh_main: float, linked_crosshair, two_d_plots: List[figure]) figure
Create a heatmap plot.
- Parameters:
title_text (str) – The title text.
arr (np.ndarray) – The input array.
rt_min (float) – The minimum retention time.
rt_max (float) – The maximum retention time.
im_min (float) – The minimum ion mobility.
im_max (float) – The maximum ion mobility.
dw_main (float) – The width of the main plot.
dh_main (float) – The height of the main plot.
linked_crosshair – The linked crosshair.
two_d_plots (List[figure]) – The list of two-dimensional plots.
- Returns:
The heatmap plot.
- Return type:
figure
- get_axis_titles() Tuple[str, str]
Returns the axis titles based on the type of heatmap.
- Returns:
The axis titles.
- Return type:
Tuple[str, str]
- get_plot_parameters(arr: DataFrame) Tuple[ndarray, ndarray, float, float, float, float, float, float]
Get parameters for plotting.
- Parameters:
arr (pd.DataFrame) – The input DataFrame.
- Returns:
The parameters for plotting.
- Return type:
Tuple[np.ndarray, np.ndarray, float, float, float, float, float, float]
- plot(featureMap: FeatureMap)
Plot the data.
Parameters: - aggregate: bool, optional (default=False)
Whether to aggregate the data before plotting.
- plot_aggregated_heatmap(featureMap: FeatureMap)
Plot an aggregated heatmap based on the provided DataFrame.
- Parameters:
df (pd.DataFrame) – The input DataFrame.
- Returns:
A list of two-dimensional plots.
- Return type:
List[figure]
- plot_individual_heatmaps(featureMap: FeatureMap)
Plot a heatmap based on the provided featureMap
- prepare_array(arr: DataFrame) ndarray
Prepare the array for plotting. Also performs equalization and/or smoothing if specified in the configuration.
- Parameters:
arr (pd.DataFrame) – The input DataFrame.
- Returns:
The prepared array.
- Return type:
np.ndarray
- show()
Show the plots.