Reference 〉Class

TimeSeries( Helipad model )

The TimeSeries class is an interface between Helipad and Matplotlib that manages drawing model data to screen during runtime. It should not be initialized by user code. Rather, import the class and use model.useVisual(TimeSeries).

Initialization Parameters

  • model Helipad, required

    The model object.


Click a method name for more detailed documentation.

  • removePlot( name, reassign )

    Removes a plot or plots and optionally reassigns their series to a different plot. This function can only be run prior to model.launchCpanel().

  • addPlot( name, label, position, … )

    Registers a plot area in the TimeSeries plot area to which data series can be added.

  • event( t, color, linestyle, … )

    Draws a vertical line on the plots area at time t. This function should not be called directly; specify an event instead.

  • toggleLine( event )

    Toggles a series on or off. This function is called when a series name is clicked in the legend of a plot.

  • update( data )

    Updates the graph area with new data. This function should not be called by the user; call GUI.step() instead to increment the model by one period and update the graph.


  • resolution int

    The time elapsing between any two data points drawn to screen (not the time elapsing between two updates, which is a user-controlled parameter). resolution increases by 10× at period 2,500, 25,000, 250,000, etc.

    Initial value: 1

  • fig matplotlib.Figure

    The Matplotlib Figure object used for rendering the graph.

  • plots dict{str:Plot}

    A dict of registered Plot objects.

  • activePlots dict{str:Plot}

    A dynamic property consisting of the subset of TimeSeries.plots that are currently selected.

  • lastUpdate int

    Because the model can be set to update the graph only every so many periods, this property records the model time when data was last drawn to the graph.

    Initial value: 0

Notes and Examples

  1. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.