|
From: theozh <th...@gm...> - 2017-11-03 00:51:37
|
Hi Martin,
if you exchange your line:
plot for [i=0:(STATS_blocks - 1)] 'data.dat' index i using (50 + (i * 5)):1 title columnheader(i + 1)
by these lines:
array XValue[3]
plot for [i=1:3] 'data.dat' u 1:(XValue[i]=$1,1) every 1:1::(i-1)::(i-1) w p ls 1 not
plot for [i=1:3] 'data.dat' u (XValue[i]):1 every 1:1:1:(i-1)::(i-1) title sprintf("%g",XValue[i])
and if you change your data such there is only one empty line instead of two, you should get your desired result.
What it basically does is
- creating an array of XValues
- the first plot just extracts the first numbers of each datablock and writes them into the array
- the second plot command finally plots at the XValues from this array.
However, seems to work but not very elegant... maybe there is a smarter way...
Limitation:
in the for loop you can't use [i=1:STATS_block] for a variable number of blocks, because apparently STATS_blocks needs two empty data lines two count datablocks, whereas "every" only allows for one empty line.
See also my other question/post about datablock separation, which hopefully somebody can comment on.
Theo.
|