Add Data To Line Graph
Adds data to a selected series of a selected graph that’s made up of pairs of x-coordinates and y-coordinates. First create a line graph widget using the Widget Editor and add one or more series as needed.
Add data to line graph [▼] for [▼] x-axis: [_] y-axis: [_]
is a code block from the Interface drawer.
Usage
Add data to line graph [▼] for [▼] x-axis: [_] y-axis: [_]
adds data to a selected series of a selected graph that’s made up of pairs of x-coordinates and y-coordinates. First create a line graph widget using the Widget Editor, and add one or more series as needed.
Syntax
Inputs:
- a graph from the dropdown menu
- a data series from the dropdown menu
- a number, this will serve as the x function along the graph
- a number, this will serve as the y function along the graph
Example
When the ‘mingle’ button is toggled, data is added to the ‘Population health’ line graph for the ‘uninfected’ (yellow sphere) population. As time goes on, data is added to the line graph for each population of the agents. This model has a high immunity rate because as the clock increases, uninfected members become immune.
Nuances
You can add many different line graphs to your simulation, and they can all use the same axes! Just be sure to use different sets of data for each line graph.