resistics.plot module#
Module to help plotting various data
- resistics.plot.lttb_downsample(x: ndarray, y: ndarray, max_pts: int = 5000) Tuple[ndarray, ndarray] [source]#
Downsample x, y for visualisation
- Parameters:
x (np.ndarray) – x array
y (np.ndarray) – y array
max_pts (int, optional) – Maximum number of points after downsampling, by default 5000
- Returns:
(new_x, new_y), the downsampled x and y arrays
- Return type:
Tuple[np.ndarray, np.ndarray]
- Raises:
ValueError – If the size of x does not match the size of y
- resistics.plot.apply_lttb(data: ndarray, max_pts: int | None) Tuple[ndarray, ndarray] [source]#
A helper function for applying lttb downsampling if max_pts is not None
- Parameters:
data (np.ndarray) – The data to downsample
max_pts (Union[int, None]) – The maximum number of points or None. If None, no downsamping is performed
- Returns:
Indices and data selected for plotting
- Return type:
Tuple[np.ndarray, np.ndarray]
- resistics.plot.plot_timeline(df: DataFrame, y_col: str, title: str = 'Timeline', ref_time: Timestamp | None = None) Figure [source]#
Plot a timeline
- Parameters:
- Returns:
Plotly figure
- Return type:
go.Figure
- resistics.plot.get_calibration_fig() Figure [source]#
Get a figure for plotting calibration data
- Returns:
Plotly figure
- Return type:
go.Figure
- resistics.plot.get_time_fig(chans: List[str], y_axis_label: Dict[str, str]) Figure [source]#
Get a figure for plotting time data