How to Export Plot using Behavior Space

18 views
Skip to first unread message

Rafida Khairani

unread,
Jun 7, 2024, 1:14:40 PMJun 7
to netlogo-users
Hi, I need Help!

Is there any possibility to export plots using BehaviorSpace? With BehaviorSpace, we can create repetitions and parameter changes. I would like to know how to get the plot for each repetition. Can you provide me with the steps?

Thankyou!

Steve Railsback

unread,
Jun 8, 2024, 8:08:26 AMJun 8
to netlogo-users
I think the best way to get file output such as an exported plot is in your code, not using BehaviorSpace.

For example, if you want to export a plot at the end of each simulation, add something like this to the code that stops the model in your go procedure.

if ticks > 100 [ ; for example if your model stops after 100 ticks
[
  let plot-file-name (word behaviorspace-run-number "plot-export.csv")
  export-plot "results-plot" plot-file-name
  stop
]

This creates a separate file for each model run in a BehaviorSpace run.
Reply all
Reply to author
Forward
0 new messages