1
votes

I am new to gnuplot, and a lot of the instructions and guides are a bit over my head. what I'm trying to do isn't that complicated, I think, but I can't seem to find clear guidance on how to do all of the parts of it.

I'm using another program, Netlogo, to create simulations. To test the differences between each different version of the models I make, I'm running them over and over, and generating data for each run which is then exported into an Excel file. The data, in this case, consists of how long each run took. So the Excel file looks like a column of numbers. I then test a different version of the model, and make a new Excel file for the data produced for this new model.

After the Excel files are created, I'm trying to use gnuplot to graph them. The goal is to make a bar graph with a bar for each version model, with the bar marking the average time it took to run a given model, with error bars based on the standard deviation. I don't really know how to approach this; I can plot the individual data points from a given Excel file, and I can also find the average. But when I try plotting the average, it gives a line from 0 to 3000 on the x-axis, and at what the average is on the y-axis. On trying histogram or box plot commands, it just gives boxes that go up to the average, from 0 to 3000 again.

Does anyone know how to do this...?

Thanks, Isaac

1

1 Answers

1
votes

If I understand you correctly the data that goes into each bar is in a separate file. Here is something to get you started: if you have a datafile model1.dat that contains the timing data for one model,

4
5
6
7

and another datafile model2.dat with the data for another model,

6
8
10
12

then the gnuplot script

models="model1 model2"
set style data boxplot
set style fill solid 0.5 
set yrange [0:15]
unset key
plot for [i=1:words(models)] word(models,i).".dat"  u (i):1:(0.5):(word(models,i))

gives

enter image description here