1
votes

I have a file with 10 columns of data (download data), there is a difference between the samples in different columns. The measurements are done for the same time but with different frequency and i have mismatches. I tried to box-plot them as a different groups with the fourth field of the using statement using x:data:width:level and I used the following code:

set style fill solid 0.25 border -1
set style boxplot outliers pointtype 7
set style data boxplot

set title 'all_templates' font 'Arial,14';
set xtics ('1' 1, '2' 2, '3' 3, '4' 4, '5' 5, '6' 6, '7' 7, '8' 8, '9' 9, '10' 10) scale 0,0
plot for [i=1:10] 'all_template.dat' using (i):i:(1):10 notitle`

but the plot looks weird, for example the median of column 9 is around 300ms but in the plot, the box, which represent column 9 does not exceed 200. It seems that the boxplot keeps taking into account the number of bins, although i specified that there are 10 different groups. Any help will be appreciated! enter image description here

1
Please show your data file, the script looks ok - Christoph
Christoph, sorry for the delay. You can find the data to the following address: data. Maybe my data is not sorted correctly. If there is some special way of formatting data for box-plots in gnuplot, please tell me! Thank you in advance! - Trifon Getsov

1 Answers

3
votes

The columns in your data file have different lengths and you use tabs as column separators. Gnuplot uses by default any white space as column separator and merges consecutive white spaces to a single one. So, two or three tabs are treated as a single column separator, which messes up your columns. Use

set datafile separator '\t'

to keep all values in the correct columns.

set style fill solid 0.25 border -1
set style boxplot outliers pointtype 7
set style data boxplot
set boxwidth 0.7 absolute

set title 'all_templates' font 'Arial,14'
set xtics 1,1,10 scale 0
set datafile separator '\t'
plot for [i=1:10] 'all_template.dat' using (i):i notitle

enter image description here