0

I want to plot data (data1.txt) that has several columns but I want to use that data only once, so for example:

ApplePrice Shop 1 Shop 2 Shop 3
Jan 10 9 8
Feb 10 10 9
Mar 9 10 10
Apr 8 9 9
May 10 10 10
...
...
etc

I know I can plot it with plot 'data1.txt' using 1:2, plot 'data1.txt' using 1:3, plot 'data1.txt' using 1:4 and I will get 3 graphs that show the price difference between the shops, but then we have to use/process the data 3 times.

My question is: Can we use the data1.txt only once to get the 3 graphs? Something like plot 'data1.txt' using 1:2, using 1:3, using 1:4? (but that doesn't work)

Any ideas?

Thanks before.

4

1 回答 1

1

是的,您可以使用特殊的 datafile '',它指的是刚刚绘制的数据。例如,

plot 'data.dat' u 1:2, '' u 1:3, '' u 1:4
于 2013-04-08T17:07:42.557 回答