little_mice
little_mice

Reputation: 177

Multiple plots from a single text file (gnuplot)

Currently, I have a text file and I'm interested in plotting two different curves from a single file(values for x axis are the same-column 1, values for y axis-columns 3 and 4). The plot should be in STDOUT since I'm working from ssh. The file that I am working with looks like this (filename: tmp)

%Iter   duration    train_objective valid_objective difference
0   6.0 0.0195735   0.0610958   0.0415223
1   5.0 0.180216    0.191344    0.011128
2   5.0 0.223318    0.241081    0.017763
3   6.0 0.245895    0.262197    0.016302
4   6.0 0.25796 0.28056 0.0226
5   6.0 0.269223    0.291769    0.022546
6   5.0 0.281187    0.298474    0.017287
7   5.0 0.283891    0.305579    0.021688
8   5.0 0.296456    0.307381    0.010925
9   5.0 0.296856    0.315487    0.018631
10  5.0 0.295805    0.321391    0.025586
Total training time is 0:06:27

So far, I can only plot the values corresponding to the 3rd column using the following line:

cat tmp | gnuplot -e "set terminal dumb size 120, 30; set autoscale; plot '-' u 1:3 with lines notitle"

Could someone tell me then how I could include the 4th column in the same plot? is that possible? Thanks!

Upvotes: 0

Views: 365

Answers (1)

Ethan
Ethan

Reputation: 15093

There is nothing in your description that rules out the trivial answer:

gnuplot -e "plot 'tmp' u 1:3 with lines, '' u 1:4 with lines"

The terminal choice is not relevant (you used 'set term dumb' but it could just as easily be any other output terminal, connection via ssh does not prevent that). If you have additional constraints that require a more complicated solution, please add them to the question.

Upvotes: 2

Related Questions