Add Data To Line Graph/en: Difference between revisions

From StarLogo Nova Wiki
(Updating to match new version of source page)
 
(Updating to match new version of source page)
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
<section begin="image"/>
<section begin="image"/>
[[File:Add data to line graph.png|alt=Add data to line graph|thumb]]
[[File:Add data to line graph.png|alt=Add data to line graph|thumb]]
<section end="image" />
<section end="image" /><p id="tooltip">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.</p>
 
<section begin="name" />{{Block|Add data to line graph [▼] for [▼] x-axis: [_] y-axis: [_]}}<section end="name" /> is a code block from the [[Interface]] drawer.
<section begin="name" />{{Block|Add data to line graph [▼] for [▼] x-axis: [_] y-axis: [_]}}<section end="name" /> is a code block from the [[Interface]] drawer.


==Usage==
==Usage==
<p id="tooltip">{{Block|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.</p>
{{Block|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==
[[File:Add DataTo LineGraph.png|right|alt=Add data to line graph Block|thumb]]
<!-- <code>Add data to line graph [Dropdown: Line Graph Widget] for [Dropdown: Data Series] x-axis: [Textbox: x function] y-axis: [Textbox: y function]</code> -->
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==
 
[[File:add_data_to_line_graph_example.gif|alt=Add Data To Line Graph example gif|thumb]]
[[File:add_data_to_line_graph_example.png|alt=Add Data To Line Graph example code|thumb]]


===Syntax===
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 [[Special:MyLanguage/Clock|clock]] increases, uninfected members become immune.
<code>Add data to line graph [Dropdown: Line Graph Widget] for [Dropdown: Data Series] x-axis: [Textbox: x function] y-axis: [Textbox: y function]</code>


==Nuances==
==Nuances==

Latest revision as of 14:44, 14 August 2023

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