0
votes

I don't know gnuplot so much and I didn't find valuable information about what I want. I would like to draw a box plot from a data file.

  • What is the format of the file?
  • Is it needed to compute mean, qc etc.?

What I would like to do is to draw a boxplot (not an histogram). Actually I have xlsx files that I can convert to CSV but I don't know if we can use csv to draw a boxplot. The demos on gnuplot are not really explicit.

1
By "drawing a box" do you mean you wish to plot you file as a histogram? Also, how can we know the format of your file when we don't know what it is! Please post some code/more words to clarify what you want to accomplishPtheguy
A boxplot is a boxplot, I can't be more precise. And for the file I have added what I have so far, but I am actually asking for information because I don't know what to use.Ecterion
The documentation is quite explicit about the format to use: Use e.g plot "file" u (1):2 with boxplot to plot the data in the second column as boxplot at x=1. All necessary value are computed by gnuplot.Christoph

1 Answers

1
votes

Here is a very simple example of a boxplot:

$data <<EOD
1
2
3
4
5
6
EOD

plot $data using (0):1 with boxplot

This does a boxplot using the values given in column 1, all statistical values are computed by gnuplot, and plots it at x-position 0. ($data is only a convenient way to describe inline data, plotting from a file with a single column work the same way with plot 'file.dat' using (0):1 with boxplot)

You can use as many columns as you want, like

$data <<EOD
1 1 1
2 2 4
3 3 5
4 3 5
5 4 6
6 6 6
EOD

set style data boxplot
plot $data using (0):1, '' using (1):2, '' using (2):3

(shorter would be plot for [i=1:3] $data using (i-1):i)

enter image description here