tvaLib
Public Member Functions | List of all members
lib.vis.visualiseOD Class Reference
Inheritance diagram for lib.vis.visualiseOD:
lib.vis.overheadPlot lib.vis.basicPlot

Public Member Functions

def __init__ (self, ODM, fig_name='OD Visualisation', kwargs)
 
def addODM (self, ODM, linescaler=2, arrowscaler=4, kwargs)
 
- Public Member Functions inherited from lib.vis.overheadPlot
def __init__ (self, alignments=None, bounding_box=None, xy_bounds=None, sateliteImage=None, sateliteResolution=None, draw_connectors=True, kwargs)
 
def setAxes (self)
 
- Public Member Functions inherited from lib.vis.basicPlot
def __init__ (self, fig_rows=1, fig_columns=1, local=None, sharex=False, sharey=False, fig_name='Basic Figure', verbose=0, figsize=[15.0, kwargs)
 
def setAxes (self, x_lavbel=['x'], y_lavbel=['y'])
 
def compileFigure (self)
 
def get (self)
 

Additional Inherited Members

- Public Attributes inherited from lib.vis.overheadPlot
 xy_bounds
 
 alignments
 
 bounding_box
 
- Public Attributes inherited from lib.vis.basicPlot
 local
 
 verbose
 
 axes
 

Detailed Description

Definition at line 1177 of file vis.py.

Constructor & Destructor Documentation

◆ __init__()

def lib.vis.visualiseOD.__init__ (   self,
  ODM,
  fig_name = 'OD Visualisation',
  kwargs 
)

Definition at line 1178 of file vis.py.

1178  def __init__(self, ODM, fig_name='OD Visualisation', **kwargs):
1179  overheadPlot.__init__(self, fig_name=fig_name, **kwargs)
1180  self.addODM(ODM, **kwargs)
1181 

Member Function Documentation

◆ addODM()

def lib.vis.visualiseOD.addODM (   self,
  ODM,
  linescaler = 2,
  arrowscaler = 4,
  kwargs 
)

Definition at line 1182 of file vis.py.

1182  def addODM(self, ODM, linescaler=2, arrowscaler=4, **kwargs):
1183  if(ODM):
1184  maxFlow = float(max([max(x) for x in ODM]))
1185  for oIx in range(len(ODM)):
1186  for dIx in range(len(ODM[oIx])):
1187  if(ODM[oIx][dIx]):
1188  scale=ODM[oIx][dIx]/maxFlow
1189  self.axes.arrow(self.alignments[oIx][0][0], self.alignments[oIx][0][1], self.alignments[dIx][-1][0]-self.alignments[oIx][0][0], self.alignments[dIx][-1][1]-self.alignments[oIx][0][1], width=scale*linescaler, head_width=scale*arrowscaler, head_length=scale*arrowscaler, color='b')
1190  self.axes.text((self.alignments[dIx][-1][0]+self.alignments[oIx][0][0])/2, (self.alignments[dIx][-1][1]+self.alignments[oIx][0][1])/2, str(ODM[oIx][dIx]), fontsize=15, color='k', va='center', ha='center')
1191  self.axes.text((self.alignments[dIx][-1][0]+self.alignments[oIx][0][0])/2, (self.alignments[dIx][-1][1]+self.alignments[oIx][0][1])/2, str(ODM[oIx][dIx]), fontsize=12, color='w', va='center', ha='center')
1192 
1193 
1194 
1195 

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