I have a datafile listing bandwidth for each machine on a network, but down and up. It looks like:
"" 0 1 2 3
"Machine 1 D" 320 768 1287 1318
"Machine 1 U" 119 245 561 491
Where the first column is the data key, and there’s 24 columns representing hours of data. I’d like to generate two histograms,(A) a rowstack that shows the total bandwidth of all the machines for each hour, and (B) a columnstack that shows each machine’s hourly usage. So, in graph A, the hours would appear on the x axis, and each machine’s usage would stack up cumulatively. In graph B, the machine names would appear on the x axis, and the usage during each hour would stack up cumulatively.
And, for extra credit, I’d like to graph the data twice, alternating rows (once for upload, once down). The trick here, is to preserve the first row as it contains column titles.
Does anyone know how to do this? I can get some results, but can’t seem to get the key/xtics/titles etc to show correctly.
EDIT: Ok, so here’s an example of what I have for a columnstack –
reset
set style fill solid noborder
file = '..\test\example.dat'
col = 24
set style data histogram
set style histogram columnstacked
plot \
for [i=2:col+1] \
file \
u i title columnhead
Which generates something like:

So, for example, how do I create a key with the column(1) fields?
In the end, I discovered a number of things. First, using iteration in gnuplot seems rather buggy – it works, but constrains other options. Second, I reported a bug where the “every” statement is incompatible with using columnheaders. Third, I can’t column/rowstack and declare the x axis as a time/date value. That left me basically writing out the plot long-hand.
columnstacked:
rowstacked: