Matplotlib Plots¶
mpl_plots ¶
plot_trajectories ¶
plot_trajectories(
trajectories: List[Trajectory], scatter_3d: bool = False
) -> Tuple[Figure, Figure, Union[Figure, None]]
Plots the trajectories in 2d or 3d using matplotlib.
This function creates one 2D or 3D plot for the xy(z) coordinates of the trajectories, one subplot for the xyz coordinates and one subplot for the rpy angles.
Parameters:
-
trajectories(List[Trajectory]) –List of trajectories to plot.
-
scatter_3d(bool, default:False) –Whether to create a 3D scatter plot. Defaults to False.
Returns:
-
Tuple[Figure, Figure, Union[Figure, None]]–Tuple[Figure, Figure, Union[Figure, None]]: Figures for the position, xyz and rpy plots.
Source code in trajectopy\visualization\mpl_plots.py
plot_correlation_heatmap ¶
plot_correlation_heatmap(
estimated_parameters: AlignmentParameters,
enabled_only: bool = True,
) -> Figure
Plots the correlation heatmap of the alignment parameters using matplotlib.
Parameters:
-
estimated_parameters(AlignmentParameters) –Estimated parameters.
-
enabled_only(bool, default:True) –Whether to consider only enabled parameters. Defaults to True.
Returns:
-
Figure–plt.Figure: Correlation heatmap figure.
Source code in trajectopy\visualization\mpl_plots.py
plot_covariance_heatmap ¶
plot_covariance_heatmap(
estimated_parameters: AlignmentParameters,
enabled_only: bool = True,
) -> Figure
Plots the covariance heatmap of the alignment parameters using matplotlib.
Parameters:
-
estimated_parameters(AlignmentParameters) –Estimated parameters.
-
enabled_only(bool, default:True) –Whether to consider only enabled parameters. Defaults to True.
Returns:
-
Figure–plt.Figure: Covariance heatmap figure.
Source code in trajectopy\visualization\mpl_plots.py
plot_ate_3d ¶
plot_ate_3d(
ate_results: List[ATEResult],
plot_settings: MPLPlotSettings = MPLPlotSettings(),
) -> Figure
Plots the ATE results in 2D using matplotlib.
Parameters:
-
ate_results(List[ATEResult]) –List of ATE results.
-
plot_settings(MPLPlotSettings, default:MPLPlotSettings()) –Plot settings. Defaults to MPLPlotSettings().
Returns:
-
Figure(Figure) –Figure containing the plot.
Source code in trajectopy\visualization\mpl_plots.py
plot_ate_bars ¶
plot_ate_bars(
ate_results: List[ATEResult],
plot_settings: MPLPlotSettings = MPLPlotSettings(),
mode: str = "positions",
) -> Figure
Plots multiple ATE results as bars for different characteristics.
Shows min, max, mean, median, rms, std using matplotlib.
Parameters:
-
ate_results(List[ATEResult]) –List of ATE results.
-
plot_settings(MPLPlotSettings, default:MPLPlotSettings()) –Plot settings. Defaults to MPLPlotSettings().
-
mode(str, default:'positions') –Mode to plot. Either 'positions' or 'rotations'. Defaults to 'positions'.
Returns:
-
Figure(Figure) –Bar plot figure.
Source code in trajectopy\visualization\mpl_plots.py
plot_compact_ate_hist ¶
plot_compact_ate_hist(
ate_result: ATEResult,
plot_settings: MPLPlotSettings = MPLPlotSettings(),
) -> Figure
Plots compact ATE histograms for the given ATEResult. The plot contains histograms for the position deviations and, if available, the rotation deviations.
Parameters:
-
ate_result(ATEResult) –ATE result to plot.
-
plot_settings(MPLPlotSettings, default:MPLPlotSettings()) –Plot settings. Defaults to MPLPlotSettings().
Returns:
-
Figure(Figure) –Figure containing the plot.
Source code in trajectopy\visualization\mpl_plots.py
plot_ate ¶
plot_ate(
ate_results: Union[ATEResult, List[ATEResult]],
plot_settings: MPLPlotSettings = MPLPlotSettings(),
) -> Figure
Plots ATE for the given ATEResult(s) as a line plot using matplotlib. If available, the plot contains the position and rotation deviations. The x-axis depends on the sorting of the trajectory.
Parameters:
-
ate_results(Union[ATEResult, List[ATEResult]]) –ATE result(s) to plot.
-
plot_settings(MPLPlotSettings, default:MPLPlotSettings()) –Plot settings. Defaults to MPLPlotSettings().
Returns:
-
Figure(Figure) –Figure containing the plot.
Source code in trajectopy\visualization\mpl_plots.py
plot_ate_dof ¶
plot_ate_dof(
ate_result: ATEResult,
plot_settings: MPLPlotSettings = MPLPlotSettings(),
) -> Figure
Plots ATE DOF (Degrees of Freedom) for the given ATEResult as a line plot using matplotlib.
The DOF plot shows the deviations in the x, y, and z directions for position and rotation.
Parameters:
-
ate_result(ATEResult) –ATE result to plot.
-
plot_settings(MPLPlotSettings, default:MPLPlotSettings()) –Plot settings. Defaults to MPLPlotSettings().
Returns:
-
Figure(Figure) –Figure containing the plot.
Source code in trajectopy\visualization\mpl_plots.py
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 | |
plot_ate_edf ¶
plot_ate_edf(
ate_results: Union[ATEResult, List[ATEResult]],
plot_settings: MPLPlotSettings = MPLPlotSettings(),
) -> Figure
Plots ATE EDF for the given ATEResult(s) as a line plot using matplotlib. The EDF (Empirical Distribution Function) shows the cumulative probability of the deviations. Using this plot, one can easily see how many percent of the deviations are below a certain value.
Parameters:
-
ate_results(Union[ATEResult, List[ATEResult]]) –ATE result to plot.
-
plot_settings(MPLPlotSettings, default:MPLPlotSettings()) –Plot settings. Defaults to MPLPlotSettings().
Returns:
-
Figure(Figure) –Figure containing the plot.
Source code in trajectopy\visualization\mpl_plots.py
plot_rpe ¶
plot_rpe(
rpe_results: List[RPEResult],
) -> Tuple[Figure, Figure]
Plots the RPE results as a line plot with violin plots for the position and rotation deviations.
Depending on the pair distance unit, the unit of the position deviations is either in meters/meters (%) or meters/seconds. The unit of the rotation deviations is respectively in degrees/m or degrees/second.
Parameters:
-
rpe_results(list[RelativeTrajectoryDeviations]) –list of RelativeTrajectoryDeviations
Returns:
-
Tuple[Figure, Figure]–Tuple[Figure, Figure]: metric and time RPE plots
Source code in trajectopy\visualization\mpl_plots.py
scatter_ate ¶
scatter_ate(
ate_result: ATEResult,
plot_settings: MPLPlotSettings = MPLPlotSettings(),
) -> Tuple[Figure, Figure]
Plots the ATE results as a scatter plot with color-coded deviations.
Parameters:
-
ate_result(ATEResult) –ATE result to plot.
-
plot_settings(MPLPlotSettings, default:MPLPlotSettings()) –Plot settings. Defaults to MPLPlotSettings().
Source code in trajectopy\visualization\mpl_plots.py
plot_positions ¶
plot_positions(
trajectories: List[Trajectory], scatter_3d: bool = False
) -> Figure
Plots xy(z) coordinates of trajectories as 2d or 3d plot
Source code in trajectopy\visualization\mpl_plots.py
plot_xyz ¶
plot_xyz(trajectories: List[Trajectory]) -> Figure
Plots xyz coordinates of trajectories as subplots
Source code in trajectopy\visualization\mpl_plots.py
plot_rpy ¶
plot_rpy(
trajectories: List[Trajectory],
) -> Union[Figure, None]
Plots rpy coordinates of trajectories as subplots