Matplotlib Plots¶
mpl_plots ¶
plot_trajectories ¶
plot_trajectories(trajectories: list[Trajectory], scatter_3d: bool = False, plot_settings: MPLPlotSettings = MPLPlotSettings()) -> tuple[Figure, Figure, 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, 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: 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
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | |
plot_ate_edf ¶
plot_ate_edf(ate_results: 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], plot_settings: MPLPlotSettings = MPLPlotSettings()) -> Figure
Plots xyz coordinates of trajectories as subplots
Source code in trajectopy\visualization\mpl_plots.py
plot_rpy ¶
plot_rpy(trajectories: list[Trajectory], plot_settings: MPLPlotSettings = MPLPlotSettings()) -> Figure | None
Plots rpy coordinates of trajectories as subplots