Reference 〉 Function

TimeSeries.addPlot( str name, str label, int position = None, bool selected = True, bool logscale = False, bool stack = False )

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

Parameters

  • name str, required

    A unique slug-type string used to refer to the plot in other functions.

  • label str, required

    The name of the plot displayed in the control panel.

  • position int, optional

    The position in which to insert the plot in the control panel list. By default the plot is appended to the end of the list. NOTE: Position is calculated as of the function call. If two plots are called with position 3 for example, the second will push the first to position 4.

    Default value: None

  • selected bool, optional

    Whether the plot should be selected by default when the control panel launches.

    Default value: True

  • logscale bool, optional

    If true, displays the plot on a logarithmic scale by default, otherwise linear. NOTE: plots can be toggled between logarithmic and linear scales regardless of the value of this parameter by pressing the 'L' key on a plot.

    Default value: False

  • stack bool, optional

    If set to True, the plot will be drawn as a stackplot rather than a line chart.

    Default value: False

Return Value Plot

The newly created TimeSeriesPlot object.

Notes and Examples

  1. charwick

    Jun 12, 2021 at 18:59

    This code adds five plots, four of them with logarithmic scales, and has all but one of them selected by default.

    from helipad.visualize import TimeSeries
    viz = heli.useVisual(TimeSeries)
    
    viz.addPlot('pop', 'Population', 1, logscale=True)
    viz.addPlot('hcap', 'Human Capital', 2, logscale=True)
    viz.addPlot('wage', 'Wage', 3)
    viz.addPlot('wealth', 'Wealth', 4, logscale=True, selected=False)
    viz.addPlot('rates', 'Rates', 5, logscale=True)

    This results in the following in the control panel (Demand, Shortages, and Utility are default plots). Note that series must be added to these plots separately.

  2. Contribute a Note

    Your email address will not be published.

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

History