Teetool Probabilistic modelling of trajectories

Public Member Functions | Private Member Functions | Private Attributes | List of all members
teetool.visual_2d.Visual_2d Class Reference

Visual_2d class generates the 2d output using Matplotlib. More...

Inheritance diagram for teetool.visual_2d.Visual_2d:

## Public Member Functions
def | __init__ (self, thisWorld, kwargs)
| Constructor for Visual_2d. More...
def | plotMean (self, list_icluster=None, colour=None, kwargs)
| Plot mean of trajectories. More...
def | plotTrajectories (self, list_icluster=None, ntraj=50, colour=None, kwargs)
| Plot trajectories of cluster. More...
def | plotTrajectoriesPoints (self, x1, list_icluster=None, ntraj=50, colour=None, kwargs)
| Plot trajectories of cluster. More...
def | plotTimeSeries (self, icluster=0, ntraj=50, colour='k', kwargs)
| Plot time-series of trajectories. More...
def | plotBox (self, coord_lowerleft, coord_upperright, kwargs)
| Plot a box based on two coordinates. More...
def | plot (self, args, kwargs)
| standard plotting function for Matplotlib More...
def | plotSamples (self, list_icluster=None, ntraj=50, colour=None, kwargs)
| Plot samples of model. More...
def | plotLegend (self)
| Add legend to plot. More...
def | plotTube (self, list_icluster=None, sdwidth=1, z=None, resolution=None, colour=None, alpha=.1, kwargs)
| Plots a confidence region of variance sigma. More...
def | plotTubeDifference (self, list_icluster=None, sdwidth=1, z=None, resolution=None, colour=None, alpha=.1, kwargs)
| Plots the difference confidence region of variance sigma for two models. More...
def | plotLogLikelihood (self, list_icluster=None, pmin=0, pmax=1, z=None, resolution=None)
| Plot the log-likehood of confidence regions – which can be related to traffic complexity in the future. More...
def | save (self, add=None)
| saves the figure to a file in the output folder More...
def | show (self)
| shows the figure (pop-up or inside notebook) More...
def | close (self)
| closes all figures More...

## Private Member Functions
def | _plotTitle (self)
| Plots an outline of the trajectories. More...

## Private Attributes
| _fig
| figure object More...
| _ax
| axis object More...
| _world
| World object. More...
| _labels
| Labels of plots. More...

## Detailed Description

Visual_2d class generates the 2d output using Matplotlib.

Even 3-dimensional trajectories can be output in 2d (sliced)

## Constructor & Destructor Documentation

## § __init__()

def teetool.visual_2d.Visual_2d.__init__ | ( |  | self,
|  |  | thisWorld,
|  |  | kwargs
| ) |  |

Constructor for Visual_2d.

Parameters

  self | object pointer
  thisWorld | World object, filled with trajectory data and models
  kwargs | additional parameters for plt.figure()
      <description>

## Member Function Documentation

## § _plotTitle()

def teetool.visual_2d.Visual_2d._plotTitle | ( |  | self | ) |
| private

Plots an outline of the trajectories.

Parameters

  self | object pointer def plotOutline(self): # TODO draw a box

Plots the title or worldname

Parameters

  self | object pointer

## § close()

def teetool.visual_2d.Visual_2d.close | ( |  | self | ) |

closes all figures

Parameters

  self | object pointer

## § plot()

def teetool.visual_2d.Visual_2d.plot | ( |  | self,
|  |  | args,
|  |  | kwargs
| ) |  |

standard plotting function for Matplotlib

Parameters

  self | object pointer
  args | additional arguments for plotting
  kwargs | additional labeled parameters for plotting

## § plotBox()

def teetool.visual_2d.Visual_2d.plotBox | ( |  | self,
|  |  | coord_lowerleft,
|  |  | coord_upperright,
|  |  | kwargs
| ) |  |

Plot a box based on two coordinates.

Parameters

  self | object pointer
  coord_lowerleft | lower-left coordinate (x,y)
  coord_upperright | upper-right coordinate (x,y)
  kwargs | additional parameters for plotting

## § plotLegend()

def teetool.visual_2d.Visual_2d.plotLegend | ( |  | self | ) |

Add legend to plot.

Parameters

  self | object pointer

## § plotLogLikelihood()

def teetool.visual_2d.Visual_2d.plotLogLikelihood | ( |  | self,
|  |  | list_icluster = `None`,
|  |  | pmin = `0`,
|  |  | pmax = `1`,
|  |  | z = `None`,
|  |  | resolution = `None`
| ) |  |

Plot the log-likehood of confidence regions – which can be related to traffic complexity in the future.

Parameters

  self | object pointer
  list_icluster | list of clusters to compare
  pmin | minimum value on a normalised scale
  pmax | maximum value on a normalised scale
  z | if specified, it evaluates the confidence region at a constant altitude for 3D trajectories
  resolution | specify resolution of region

## § plotMean()

def teetool.visual_2d.Visual_2d.plotMean | ( |  | self,
|  |  | list_icluster = `None`,
|  |  | colour = `None`,
|  |  | kwargs
| ) |  |

Plot mean of trajectories.

Parameters

  self | object pointer
  list_icluster | list of clusters to plot
  colour | if specified, overwrites distinct colours
  kwargs | additional parameters for plotting

## § plotSamples()

def teetool.visual_2d.Visual_2d.plotSamples | ( |  | self,
|  |  | list_icluster = `None`,
|  |  | ntraj = `50`,
|  |  | colour = `None`,
|  |  | kwargs
| ) |  |

Plot samples of model.

Parameters

  self | object pointer
  list_icluster | list of clusters to plot
  ntraj | number of trajectories
  colour | if specified, overwrites distinct colours
  kwargs | additional parameters for plotting

## § plotTimeSeries()

def teetool.visual_2d.Visual_2d.plotTimeSeries | ( |  | self,
|  |  | icluster = `0`,
|  |  | ntraj = `50`,
|  |  | colour = `'k'`,
|  |  | kwargs
| ) |  |

Plot time-series of trajectories.

Parameters

  self | object pointer
  icluster | select cluster to plot
  ntraj | maximum number of trajectories
  colour | specificy colour of trajectories
  kwargs | additional parameters for plotting

## § plotTrajectories()

def teetool.visual_2d.Visual_2d.plotTrajectories | ( |  | self,
|  |  | list_icluster = `None`,
|  |  | ntraj = `50`,
|  |  | colour = `None`,
|  |  | kwargs
| ) |  |

Plot trajectories of cluster.

Parameters

  self | object pointer
  list_icluster | list of clusters to plot
  ntraj | maximum number of trajectories
  colour | if specified, overwrites distinct colours
  kwargs | additional parameters for plotting

## § plotTrajectoriesPoints()

def teetool.visual_2d.Visual_2d.plotTrajectoriesPoints | ( |  | self,
|  |  | x1,
|  |  | list_icluster = `None`,
|  |  | ntraj = `50`,
|  |  | colour = `None`,
|  |  | kwargs
| ) |  |

Plot trajectories of cluster.

Parameters

  self | object pointer
  x1 | point from [0,1] to visualise
  list_icluster | list of clusters to plot
  ntraj | maximum number of trajectories
  colour | if specified, overwrites distinct colours
  kwargs | additional parameters for plotting

## § plotTube()

def teetool.visual_2d.Visual_2d.plotTube | ( |  | self,
|  |  | list_icluster = `None`,
|  |  | sdwidth = `1`,
|  |  | z = `None`,
|  |  | resolution = `None`,
|  |  | colour = `None`,
|  |  | alpha = `.1`,
|  |  | kwargs
| ) |  |

Plots a confidence region of variance sigma.

Parameters

  self | object pointer
  list_icluster | list of clusters to plot
  sdwidth | variance to evaluate
  z | if specified, it evaluates the confidence region at a constant altitude for 3D trajectories
  resolution | sets resolution for which to calculate the tube, can be a single integer, or an actual measurement [dim1 dim2] (2d) [dim1 dim2 dim3] (3d)
  colour | if specified, overwrites distinct colours
  alpha | opacity for the confidence region
  kwargs | additional parameters for plotting

## § plotTubeDifference()

def teetool.visual_2d.Visual_2d.plotTubeDifference | ( |  | self,
|  |  | list_icluster = `None`,
|  |  | sdwidth = `1`,
|  |  | z = `None`,
|  |  | resolution = `None`,
|  |  | colour = `None`,
|  |  | alpha = `.1`,
|  |  | kwargs
| ) |  |

Plots the difference confidence region of variance sigma for two models.

Parameters

  self | object pointer
  list_icluster | list of 2 clusters to compare
  sdwidth | variance to evaluate
  z | if specified, it evaluates the confidence region at a constant altitude for 3D trajectories
  resolution | specify resolution of region
  colour | if specified, overwrites distinct colours
  alpha | opacity for the confidence region
  kwargs | additional parameters for plotting

## § save()

def teetool.visual_2d.Visual_2d.save | ( |  | self,
|  |  | add = `None`
| ) |  |

saves the figure to a file in the output folder

Parameters

  self | object pointer
  add | additional identifier for file

## § show()

def teetool.visual_2d.Visual_2d.show | ( |  | self | ) |

shows the figure (pop-up or inside notebook)

Parameters

  self | object pointer

## Member Data Documentation

## § _ax

teetool.visual_2d.Visual_2d._ax
| private

axis object

## § _fig

teetool.visual_2d.Visual_2d._fig
| private

figure object

## § _labels

teetool.visual_2d.Visual_2d._labels
| private

Labels of plots.

## § _world

teetool.visual_2d.Visual_2d._world
| private

World object.

The documentation for this class was generated from the following file:

- teetool/visual_2d.py