I have csv file data.dat for example with these values:
#W=1
0;sqlite;11500
1;hsql;14550
2;h2;17550
#W=2
0;sqlite;11000
1;hsql;13800
2;h2;16500
#W=3
0;sqlite;11000
1;hsql;13800
2;h2;16500
#W=4
0;sqlite;11000
1;hsql;13800
2;h2;16500
I need to plot bar charts into pdf. each data for each graph starts with title #W1,#W2....
i have tried this script:
cat << __EOF | gnuplot -persist
set terminal pdf
set output 'out.pdf'
set datafile separator ";"
set boxwidth 0.5
set style fill solid
plot "data2.dat" using 1:3:xtic(2) with boxes
__EOF
giving this output:

how can i make more graphs (4 in this example but there could more or less) from one datafile each graph separately under previous one?
Edit: each graph can have different number of bars not only three as in previous example. File data2.dat could also look like this:
#W=1
0;sqlite;11500
1;hsql;14550
2;h2;17550
3;derby;8500
4;sqlite;13550
5;h2;19250
#W=2
0;sqlite;11000
1;hsql;13800
This script from Miguel answer works fine when there are 3 bars for each graph but i dont know how to change it to plot more or less bars.
cat << __EOF | gnuplot -persist
set terminal pdf
set datafile separator ";"
set boxwidth 0.5
set style fill solid
do for [i=0:3] {
set output 'out'.i.'.pdf'
plot "data2.dat" using 1:3:xtic(2) every ::(i*3)::(i*3+3) with boxes
}
__EOF
also if it would be possible i would like to have a graph tittle according to header value of each dataset (W=1, W=2....)

