Skip to content
Clifford Bohm edited this page Jul 27, 2017 · 12 revisions

MABE comes with a Python tool called MGraph.py which can generate graphs from MABE data.

Requirements

In order to make graphs you will need to have Python and matplotlib (a graphing package for python) installed. You can find guides online to help install both of these. It is advisable to install the latest version of python (version 3.0 or later as opposed to 2).

MGraph.py

MGraph.py is a graphing program that makes graphs from csv files...
While this program will not generate all of the possible graphs that you might need, it provides a way for you to visualize your data with minimal effort.

to run MGraph.py enter:

python [path to your MABE code]/PythonTools/MGraph.py

If you run MGraph.py in a directory where you have run MABE, graphs will automatically be generated from the pop.csv and max.csv files. These graphs are generated for every column in pop.csv, in addition, the same columns from max.csv are also graphed. After a few seconds, you should see images like these...

To quit, either close these images or press <ctrl-c> on the command line and then scroll over one of the images.

mkGraphsFromDefaultRun.py Custom Graphs

MGraph.py can also render custom graphs. For example to create a graph with food1, food2, score and switches graphed against updates:

python PythonTools/MGraph.py -files ave -data food1_AVE food2_AVE score_AVE switches_AVE -combineData -pltStyle randomLine"

MGraph.py -h option

We continue to add features to MGraph.py. To see all of the options run MGraph.py with the "-h" option.

python PythonTools/MGraph.py -h
Clone this wiki locally