BehaviourComposer: ignore everything before this. Begin micro-behaviour: Begin description: Set up an area for other micro-behaviours to draw graphs. The location, size, minimum, and maximum values can all be specified. End description Create empty plot Begin NetLogo code: substitute-text-area-for upper-left-corner-x 5 substitute-text-area-for upper-left-corner-y 550 substitute-text-area-for lower-right-corner-x 420 substitute-text-area-for lower-right-corner-y 809 substitute-text-area-for plot-label Random Plot substitute-text-area-for x-axis-label time substitute-text-area-for y-axis-label random substitute-text-area-for minimum-x-value 0 substitute-text-area-for maximum-x-value 100 substitute-text-area-for minimum-y-value 0 substitute-text-area-for maximum-y-value 200 substitute-text-area-for legends "random value" "black" create-plot "upper-left-corner-x" "upper-left-corner-y"Â ; upper left corner (from the upper left corner of the applet) "lower-right-corner-x" "lower-right-corner-y"Â ; lower right corner "plot-label"Â ; unique name (and label) for this plot "x-axis-label"Â ; X axis label "y-axis-label"Â ; Y axis label "minimum-x-value"Â ; minimum x value "maximum-x-value"Â ; maximum x value "minimum-y-value"Â ; minimum y value "maximum-y-value"Â ; maximum y value legends ; legends is either alternating pen names and color names, false meaning no legend, or ; true meaning legend generated via Add to plot End NetLogo code VariantsYou can change all the attributes in text areas to change the size, location, labels, minimum, or maximum values. You can add a legend by editing the last text area. Supported colors are black, white, gray, red, orange, brown, yellow, green, lime, turquoise, cyan, sky, blue, violet, magenta, and pink. To remove all legends edit the last area to be empty. How this worksThis uses the Behaviour Composer primitive create-plot that defines a plot in the NetLogo file that is added during loading and cannot be removed during a run. Related micro-behavioursAdd to plot can be used to add plots to this graph. Multiple plots can be drawn on the same graph. HistoryCreate empty plot was implemented by Ken Kahn. BehaviourComposer: ignore everything after this. |