baglab.plot¶
baglab.plot
¶
Plotting utilities for rosbag data analysis.
plot_error_band(t, error, sigma=None, label=None, title=None, ax=None)
¶
Plot error time series with optional +/-sigma shaded band.
Parameters¶
t : pd.Series | np.ndarray Time axis. error : pd.Series | np.ndarray Error values. sigma : float | None Standard deviation for the band. Computed from error when None. label : str | None Label for the error line. title : str | None Axes title. ax : matplotlib.axes.Axes | None Axes to draw on. A new figure is created when None.
Returns¶
matplotlib.axes.Axes The axes with the plot.
plot_step_response(t, actual, target, title=None, ax=None)
¶
Plot step response with target line and settling band.
A horizontal line is drawn at the target value and a shaded region indicates the +/-2 % settling band around the target.
Parameters¶
t : pd.Series | np.ndarray Time axis. actual : pd.Series | np.ndarray Measured response. target : float | pd.Series | np.ndarray Target (setpoint) value. If scalar, a horizontal line is drawn. title : str | None Axes title. ax : matplotlib.axes.Axes | None Axes to draw on. A new figure is created when None.
Returns¶
matplotlib.axes.Axes The axes with the plot.
plot_timeseries(t, *series, labels=None, ylabel=None, title=None, ax=None)
¶
Plot one or more time series on the same axes.
Parameters¶
t : pd.Series | np.ndarray Time axis. series : pd.Series | np.ndarray One or more data series to plot against t. labels : list[str] | None Legend labels. If provided, a legend is shown. ylabel : str | None Y-axis label. title : str | None Axes title. ax : matplotlib.axes.Axes | None Axes to draw on. A new figure is created when None*.
Returns¶
matplotlib.axes.Axes The axes with the plot.
plot_xy_trajectory(x, y, ref_x=None, ref_y=None, label='actual', ref_label='reference', title=None, ax=None)
¶
Plot a 2-D trajectory with optional reference path.
Parameters¶
x, y : pd.Series | np.ndarray Actual path coordinates. ref_x, ref_y : pd.Series | np.ndarray | None Optional reference path coordinates. label : str Label for the actual path. ref_label : str Label for the reference path. title : str | None Axes title. ax : matplotlib.axes.Axes | None Axes to draw on. A new figure is created when None.
Returns¶
matplotlib.axes.Axes The axes with the plot.