suboptimumg.plotting.utils#
- class suboptimumg.plotting.utils.DataType3D(*values)[source]#
Bases:
EnumWhether 3D plot data is given on a grid or as scattered points.
- GridInput = 'GridInput'#
- ScatterInput = 'ScatterInput'#
- suboptimumg.plotting.utils.prepare_smooth_data_2D(x_list, y_list, smoothing_config)[source]#
Interpolate and smooth (x, y) data for 2D plots.
- Parameters:
x_list (NDArray[float64]) – X coordinates
y_list (NDArray[float64]) – Y coordinates
smoothing_config (SmoothingConfig) – Smoothing and interpolation settings
- Returns:
x_dense (NDArray[float64]) – Smoothed/interpolated x coordinates
y_dense (NDArray[float64]) – Smoothed/interpolated y coordinates
- Return type:
tuple[NDArray[float64], NDArray[float64]]
- suboptimumg.plotting.utils.prepare_smooth_data_3D(x_list, y_list, z_list, smoothing_config=SmoothingConfig(interp_factor=5, smoothing_sigma=0, interp_method='linear'))[source]#
Interpolate and smooth grid-based data for 3D plots.
Requires grid-based input data.
- Parameters:
x_list (NDArray[float64]) – 1D array of x coordinates defining the grid x-axis
y_list (NDArray[float64]) – 1D array of y coordinates defining the grid y-axis
z_list (NDArray[float64]) – 2D array of z values with shape (len(x_list), len(y_list))
smoothing_config (SmoothingConfig, optional) – Smoothing and interpolation settings
- Returns:
x_interp (NDArray[float64]) – Interpolated x coordinates
y_interp (NDArray[float64]) – Interpolated y coordinates
z_interp (NDArray[float64]) – Smoothed and interpolated z values
- Return type:
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
- suboptimumg.plotting.utils.prepare_smooth_data_3D_scatter(x_list, y_list, z_list, smoothing_config=SmoothingConfig(interp_factor=5, smoothing_sigma=0, interp_method='linear'))[source]#
Interpolate scattered 3D data onto a regular grid.
Requires scatter-based input data (1D x, y, z arrays).
- Parameters:
x_list (NDArray[float64]) – 1D array of x coordinates
y_list (NDArray[float64]) – 1D array of y coordinates
z_list (NDArray[float64]) – 1D array of z values
smoothing_config (SmoothingConfig, optional) – Smoothing and interpolation settings
- Returns:
x_interp (NDArray[float64]) – Regular grid x coordinates
y_interp (NDArray[float64]) – Regular grid y coordinates
z_interp (NDArray[float64]) – Interpolated z values on regular grid suitable for surface/contour plots
- Return type:
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
- suboptimumg.plotting.utils.validate_data(x_list, y_list, z_list)[source]#
Determine if the input data is grid-based or scatter-based.
- Parameters:
x_list (NDArray[float64]) – X coordinates
y_list (NDArray[float64]) – Y coordinates
z_list (NDArray[float64]) – Z values
- Returns:
Whether data is GridInput or ScatterInput
- Return type:
- Raises:
ValueError – If data dimensions are invalid or mismatched