lightlab.util.plot module

Summary

Classes:

DynamicLine A line that can refresh when called

Functions:

plotCovEllipse Plots an ellipse enclosing volume based on the specified covariance matrix (cov) and location (pos).

Reference

class DynamicLine(formatStr='b-', existing=None, geometry=[(0, 0), (4, 4)])[source]

Bases: object

A line that can refresh when called

Parameters:
  • formatStr (str) – plotting line format
  • existing (Figure/DynamicLine) – reference to an existing plot to which this DynamicLine instance will be added
  • geometry (list[Tuple,Tuple]) – a 2-element list of 2-tuples of bottom-left (pixels) and width-height (inches)
refresh(xdata, ydata)[source]

Refresh the data displayed in the plot

Parameters:
  • xdata (array) – X data
  • ydata (array) – Y data
close()[source]

Close the figure window.

Further calls to refresh() will cause an error

plotCovEllipse(cov, pos, volume=0.5, ax=None, **kwargs)[source]

Plots an ellipse enclosing volume based on the specified covariance matrix (cov) and location (pos). Additional keyword arguments are passed on to the ellipse patch artist.

Parameters:
  • cov – The 2x2 covariance matrix to base the ellipse on
  • pos – The location of the center of the ellipse. Expects a 2-element sequence of [x0, y0].
  • volume – The volume inside the ellipse; defaults to 0.5
  • ax – The axis that the ellipse will be plotted on. Defaults to the current axis.
  • kwargs – passed to Ellipse plotter