Reference 〉 Function

TimeSeriesPlot.addSeries(reporterstr|func(int), labelstr, colorstr|Color, stylestr'-', visibleboolTrue)

Registers a reporter to be drawn in a particular plot during the model’s runtime.

Parameters

  • reporter str|func(int), required

    A reference to a previously registered reporter, or a function that takes the model time (int) as its only argument and returns a numeric. See data.addReporter(). Reporters which have been registered with subplots – for example, percentiles or standard deviations – will be plotted as lighter dotted lines. See data.agentReporter().

  • label str, required

    The name of the series to be displayed in the legend on the plot. Pass '' to not show the series in the legend.

  • color str|Color, required

    The color of the series line. Can take a hex string, a color name string (see the Matplotlib documentation for valid values), an RGB tuple with ranges from 0.0 to 1.0, or a Color object.

  • style str, optional

    Allows for alternatives to solid lines, such as dotted lines. Default value produces a solid line. See Matplotlib linestyle reference for possible values.

    Default value: '-'

  • visible bool, optional

    Whether the series should be toggled on or off by default when the plot is drawn. This parameter is ignored for series added to a stackplot, since individual stackplot series cannot be toggled.

    Default value: True

Return Value Series

The newly created Series object.

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.

History