BehaviourComposer: ignore everything before this. Begin micro-behaviour: Begin description: Plot data on top of a plot using a previously defined pen. End description Add pen to add to plot Begin NetLogo code: substitute-text-area-for plot-label Hunger Plotsubstitute-text-area-for color-of-pen redsubstitute-text-area-for name-of-pen Hunger substitute-text-area-for x-value timesubstitute-text-area-for y-value my-hungersubstitute-text-area-for kind-of-pen 0 substitute-text-area-for erase-pen ; plot-pen-resetset-current-plot "plot-label"set-current-plot-pen "name-of-pen"set-plot-pen-color color-of-penset-plot-pen-mode kind-of-pen ; 0 for line, 1 for bar, 2 for pointerase-pen ; remove the ';' in the box to erase everything drawn by this penadd-to-plot x-value y-value End NetLogo code VariantsTypically you'll want to enhance this to happen repeatedly. You can change any of the values in text boxes. Named colours are black, white, gray, red, orange, brown, yellow, green, lime, turquoise, cyan, sky, blue, violet, magenta, and pink. More colors can be specified. How this worksIt uses a pen to update the plot named in the first text box. Related micro-behavioursAdd to plot uses a new pen. This draws a pre-defined empty plot defined by Create empty auto plot or Create empty plot. HistoryAdd pen to add to plot was implemented by Ken Kahn on 2 April 2010. BehaviourComposer: ignore everything after this. |