Add Data To Line Graph

From StarLogo Nova Wiki
Other languages:


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

Add data to line graph Block

Inputs:

  1. a graph from the dropdown menu
  2. a data series from the dropdown menu
  3. a number, this will serve as the x function along the graph
  4. a number, this will serve as the y function along the graph

Example

Add Data To Line Graph example code

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.

Related Blocks