Functions
gtsam.utils.plot Namespace Reference

Functions

Tuple[np.ndarray, np.ndarray, np.ndarray] ellipsoid (float rx, float ry, float rz, int n)
 
def plot_3d_points (fignum, values, linespec="g*", marginals=None, title="3D Points", axis_labels=('X axis', 'Y axis', 'Z axis'))
 
None plot_covariance_ellipse_2d (axes, Point2 origin, np.ndarray covariance)
 
None plot_covariance_ellipse_3d (axes, Point3 origin, np.ndarray P, float scale=1, int n=8, float alpha=0.5)
 
None plot_incremental_trajectory (int fignum, Values values, int start=0, float scale=1, Optional[Marginals] marginals=None, float time_interval=0.0)
 
plt.Figure plot_point2 (int fignum, Point2 point, str linespec, np.ndarray P=None, Iterable[str] axis_labels=("X axis", "Y axis"))
 
None plot_point2_on_axes (axes, Point2 point, str linespec, Optional[np.ndarray] P=None)
 
plt.Figure plot_point3 (int fignum, Point3 point, str linespec, np.ndarray P=None, Iterable[str] axis_labels=("X axis", "Y axis", "Z axis"))
 
None plot_point3_on_axes (axes, Point3 point, str linespec, Optional[np.ndarray] P=None)
 
plt.Figure plot_pose2 (int fignum, Pose2 pose, float axis_length=0.1, np.ndarray covariance=None, axis_labels=("X axis", "Y axis", "Z axis"))
 
None plot_pose2_on_axes (axes, Pose2 pose, float axis_length=0.1, np.ndarray covariance=None)
 
plt.Figure plot_pose3 (int fignum, Pose3 pose, float axis_length=0.1, np.ndarray P=None, Iterable[str] axis_labels=("X axis", "Y axis", "Z axis"))
 
def plot_pose3_on_axes (axes, pose, axis_length=0.1, P=None, scale=1)
 
None plot_trajectory (int fignum, Values values, float scale=1, Marginals marginals=None, str title="Plot Trajectory", Iterable[str] axis_labels=("X axis", "Y axis", "Z axis"))
 
None set_axes_equal (int fignum)
 

Detailed Description

Various plotting utlities.

Function Documentation

◆ ellipsoid()

Tuple[np.ndarray, np.ndarray, np.ndarray] gtsam.utils.plot.ellipsoid ( float  rx,
float  ry,
float  rz,
int  n 
)
Numpy equivalent of Matlab's ellipsoid function.

Args:
    rx: Radius of ellipsoid in X-axis.
    ry: Radius of ellipsoid in Y-axis.
    rz: Radius of ellipsoid in Z-axis.
    n: The granularity of the ellipsoid plotted.

Returns:
    The points in the x, y and z axes to use for the surface plot.

Definition at line 65 of file plot.py.

◆ plot_3d_points()

def gtsam.utils.plot.plot_3d_points (   fignum,
  values,
  linespec = "g*",
  marginals = None,
  title = "3D Points",
  axis_labels = ('X axis', 'Y axis', 'Z axis') 
)
Plots the Point3s in `values`, with optional covariances.
Finds all the Point3 objects in the given Values object and plots them.
If a Marginals object is given, this function will also plot marginal
covariance ellipses for each point.

Args:
    fignum (int): Integer representing the figure number to use for plotting.
    values (gtsam.Values): Values dictionary consisting of points to be plotted.
    linespec (string): String representing formatting options for Matplotlib.
    marginals (numpy.ndarray): Marginal covariance matrix to plot the
        uncertainty of the estimation.
    title (string): The title of the plot.
    axis_labels (iterable[string]): List of axis labels to set.

Definition at line 349 of file plot.py.

◆ plot_covariance_ellipse_2d()

None gtsam.utils.plot.plot_covariance_ellipse_2d (   axes,
Point2  origin,
np.ndarray  covariance 
)
Plots a Gaussian as an uncertainty ellipse

The ellipse is scaled in such a way that 95% of drawn samples are inliers.
Derivation of the scaling factor is explained at the beginning of this file.

Args:
    axes (matplotlib.axes.Axes): Matplotlib axes.
    origin: The origin in the world frame.
    covariance: The marginal covariance matrix of the 2D point
                which will be represented as an ellipse.

Definition at line 131 of file plot.py.

◆ plot_covariance_ellipse_3d()

None gtsam.utils.plot.plot_covariance_ellipse_3d (   axes,
Point3  origin,
np.ndarray  P,
float   scale = 1,
int   n = 8,
float   alpha = 0.5 
)
Plots a Gaussian as an uncertainty ellipse

The ellipse is scaled in such a way that 95% of drawn samples are inliers.
Derivation of the scaling factor is explained at the beginning of this file.

Args:
    axes (matplotlib.axes.Axes): Matplotlib axes.
    origin: The origin in the world frame.
    P: The marginal covariance matrix of the 3D point
        which will be represented as an ellipse.
    scale: Scaling factor of the radii of the covariance ellipse.
    n: Defines the granularity of the ellipse. Higher values indicate finer ellipses.
    alpha: Transparency value for the plotted surface in the range [0, 1].

Definition at line 88 of file plot.py.

◆ plot_incremental_trajectory()

None gtsam.utils.plot.plot_incremental_trajectory ( int  fignum,
Values  values,
int   start = 0,
float   scale = 1,
Optional[Marginals]   marginals = None,
float   time_interval = 0.0 
)
Incrementally plot a complete 3D trajectory using poses in `values`.

Args:
    fignum: Integer representing the figure number to use for plotting.
    values: Values dict containing the poses.
    start: Starting index to start plotting from.
    scale: Value to scale the poses by.
    marginals: Marginalized probability values of the estimation.
        Used to plot uncertainty bounds.
    time_interval: Time in seconds to pause between each rendering.
        Used to create animation effect.

Definition at line 534 of file plot.py.

◆ plot_point2()

plt.Figure gtsam.utils.plot.plot_point2 ( int  fignum,
Point2  point,
str  linespec,
np.ndarray   P = None,
Iterable[str]   axis_labels = ("X axis", "Y axis") 
)
Plot a 2D point on given figure with given `linespec`.

The uncertainty ellipse (if covariance is given) is scaled in such a way
that 95% of drawn samples are inliers, see `plot_covariance_ellipse_2d`.

Args:
    fignum: Integer representing the figure number to use for plotting.
    point: The point to be plotted.
    linespec: String representing formatting options for Matplotlib.
    P: Marginal covariance matrix to plot the uncertainty of the estimation.
    axis_labels: List of axis labels to set.

Returns:
    fig: The matplotlib figure.

Definition at line 184 of file plot.py.

◆ plot_point2_on_axes()

None gtsam.utils.plot.plot_point2_on_axes (   axes,
Point2  point,
str  linespec,
Optional[np.ndarray]   P = None 
)
Plot a 2D point and its corresponding uncertainty ellipse on given axis
`axes` with given `linespec`.

The uncertainty ellipse (if covariance is given) is scaled in such a way
that 95% of drawn samples are inliers, see `plot_covariance_ellipse_2d`.

Args:
    axes (matplotlib.axes.Axes): Matplotlib axes.
    point: The point to be plotted.
    linespec: String representing formatting options for Matplotlib.
    P: Marginal covariance matrix to plot the uncertainty of the estimation.

Definition at line 162 of file plot.py.

◆ plot_point3()

plt.Figure gtsam.utils.plot.plot_point3 ( int  fignum,
Point3  point,
str  linespec,
np.ndarray   P = None,
Iterable[str]   axis_labels = ("X axis", "Y axis", "Z axis") 
)
Plot a 3D point on given figure with given `linespec`.

The uncertainty ellipse (if covariance is given) is scaled in such a way
that 95% of drawn samples are inliers, see `plot_covariance_ellipse_3d`.

Args:
    fignum: Integer representing the figure number to use for plotting.
    point: The point to be plotted.
    linespec: String representing formatting options for Matplotlib.
    P: Marginal covariance matrix to plot the uncertainty of the estimation.
    axis_labels: List of axis labels to set.

Returns:
    fig: The matplotlib figure.

Definition at line 311 of file plot.py.

◆ plot_point3_on_axes()

None gtsam.utils.plot.plot_point3_on_axes (   axes,
Point3  point,
str  linespec,
Optional[np.ndarray]   P = None 
)
Plot a 3D point on given axis `axes` with given `linespec`.

The uncertainty ellipse (if covariance is given) is scaled in such a way
that 95% of drawn samples are inliers, see `plot_covariance_ellipse_3d`.

Args:
    axes (matplotlib.axes.Axes): Matplotlib axes.
    point: The point to be plotted.
    linespec: String representing formatting options for Matplotlib.
    P: Marginal covariance matrix to plot the uncertainty of the estimation.

Definition at line 290 of file plot.py.

◆ plot_pose2()

plt.Figure gtsam.utils.plot.plot_pose2 ( int  fignum,
Pose2  pose,
float   axis_length = 0.1,
np.ndarray   covariance = None,
  axis_labels = ("X axis", "Y axis", "Z axis") 
)
Plot a 2D pose on given figure with given `axis_length`.

The uncertainty ellipse (if covariance is given) is scaled in such a way
that 95% of drawn samples are inliers, see `plot_covariance_ellipse_2d`.

Args:
    fignum: Integer representing the figure number to use for plotting.
    pose: The pose to be plotted.
    axis_length: The length of the camera axes.
    covariance: Marginal covariance matrix to plot
        the uncertainty of the estimation.
    axis_labels (iterable[string]): List of axis labels to set.

Definition at line 255 of file plot.py.

◆ plot_pose2_on_axes()

None gtsam.utils.plot.plot_pose2_on_axes (   axes,
Pose2  pose,
float   axis_length = 0.1,
np.ndarray   covariance = None 
)
Plot a 2D pose on given axis `axes` with given `axis_length`.

The ellipse is scaled in such a way that 95% of drawn samples are inliers,
see `plot_covariance_ellipse_2d`.

Args:
    axes (matplotlib.axes.Axes): Matplotlib axes.
    pose: The pose to be plotted.
    axis_length: The length of the camera axes.
    covariance (numpy.ndarray): Marginal covariance matrix to plot
        the uncertainty of the estimation.

Definition at line 218 of file plot.py.

◆ plot_pose3()

plt.Figure gtsam.utils.plot.plot_pose3 ( int  fignum,
Pose3  pose,
float   axis_length = 0.1,
np.ndarray   P = None,
Iterable[str]   axis_labels = ("X axis", "Y axis", "Z axis") 
)
Plot a 3D pose on given figure with given `axis_length`.

The uncertainty ellipse (if covariance is given) is scaled in such a way
that 95% of drawn samples are inliers, see `plot_covariance_ellipse_3d`.

Args:
    fignum: Integer representing the figure number to use for plotting.
    pose (gtsam.Pose3): 3D pose to be plotted.
    axis_length: The length of the camera axes.
    P: Marginal covariance matrix to plot the uncertainty of the estimation.
    axis_labels: List of axis labels to set.

Returns:
    fig: The matplotlib figure.

Definition at line 436 of file plot.py.

◆ plot_pose3_on_axes()

def gtsam.utils.plot.plot_pose3_on_axes (   axes,
  pose,
  axis_length = 0.1,
  P = None,
  scale = 1 
)
Plot a 3D pose on given axis `axes` with given `axis_length`.

The uncertainty ellipse (if covariance is given) is scaled in such a way
that 95% of drawn samples are inliers, see `plot_covariance_ellipse_3d`.

Args:
    axes (matplotlib.axes.Axes): Matplotlib axes.
    point (gtsam.Point3): The point to be plotted.
    linespec (string): String representing formatting options for Matplotlib.
    P (numpy.ndarray): Marginal covariance matrix to plot the uncertainty of the estimation.

Definition at line 397 of file plot.py.

◆ plot_trajectory()

None gtsam.utils.plot.plot_trajectory ( int  fignum,
Values  values,
float   scale = 1,
Marginals   marginals = None,
str   title = "Plot Trajectory",
Iterable[str]   axis_labels = ("X axis", "Y axis", "Z axis") 
)
Plot a complete 2D/3D trajectory using poses in `values`.

Args:
    fignum: Integer representing the figure number to use for plotting.
    values: Values containing some Pose2 and/or Pose3 values.
    scale: Value to scale the poses by.
    marginals: Marginalized probability values of the estimation.
        Used to plot uncertainty bounds.
    title: The title of the plot.
    axis_labels (iterable[string]): List of axis labels to set.

Definition at line 475 of file plot.py.

◆ set_axes_equal()

None gtsam.utils.plot.set_axes_equal ( int  fignum)
Make axes of 3D plot have equal scale so that spheres appear as spheres,
cubes as cubes, etc..  This is one possible solution to Matplotlib's
ax.set_aspect('equal') and ax.axis('equal') not working for 3D.

Args:
  fignum: An integer representing the figure number for Matplotlib.

Definition at line 36 of file plot.py.



gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:53:08