gnuplot - 跳过前两行

gnuplot - skip first two lines

假设我有一个 .csv 文件,如下所示:

<empty> <empty> 8       <empty> <empty> <empty> 16      <empty> ...
<empty> X       A       B       C       D       A       B       ...
<inval>    <x1> <y8A1>  <y8B1>  <y8C1>  <y8D1>  <y16A1> <y16B1> ... 
<inval>    <x2> <y8A2>  <y8B2>  <y8C2>  <y8D2>  <y16A2> <y16B2> ...
...     ...     ...     ...     ...     ...     ...     ...

例如:

,,8,,,,16,,,,32,,,,48,,,,64,,,
,"clients","Tput – avg","Tput-std","Rtime-avg","Rtime-std","Tput – avg","Tput-std","Rtime-avg","Rtime-std","Tput – avg","Tput-std","Rtime-avg","Rtime-std","Tput – avg","Tput-std","Rtime-avg","Rtime-std","Tput – avg","Tput-std","Rtime-avg","Rtime-std"
10,50,9039.0819672131,433.6998870707,5887.1590163935,6804.7096885246,10801.1065573771,484.5072480861,4935.1245901639,4391.0008360656,10280.6721311475,495.4616072373,5171.7918032787,5172.7538688525,10142.2131147541,599.0469547239,5312.6901639344,6127.9184590164,9556.3524590164,600.6814146608,5730.8081967213,7182.2055245902
30,150,8809.0163934426,460.0830843491,17358.5344262295,25936.6244098361,14158.1229508197,718.1770594822,10958.9131147541,10945.2590163934,14780.737704918,835.4988255869,10563.8032786885,7641.2886065574,15027.8196721311,850.0582701307,10332.4655737705,7341.2337868853,14616.6885245902,866.1246635524,10659.8770491803,8198.0366229508
50,250,9353.9672131148,432.8189015728,27318.1,45790.2556229508,13702.3852459016,707.6747849944,18785.6590163934,23324.8483770492,15943.6557377049,677.4546640345,16035.2606557377,10461.7719180328,15860.1721311475,830.4099751453,16213.0213114754,10124.9612131148,15326.0163934426,1031.17034143,16795.6081967213,10698.6249508197
70,350,8881.5573770492,726.9289548887,40686.8491803279,72405.878295082,13387.4426229508,445.5236398053,26757.5327868852,32890.1623606557,16645.6885245902,626.5893434468,21494.2508196721,13007.9780327869,16789.1393442623,808.3621538696,21347.3950819672,13930.1256229508,16718.9836065574,668.181132478,21345.6196721311,12401.9711311475
90,450,8746.4180327869,500.6200091656,52822.9016393443,93682.0274754098,13743.131147541,455.9099951486,33312.6508196721,46968.4851967213,16682.4098360656,904.7721063143,27619.7491803279,17528.359704918,17071,1066.3633936871,27044.6049180328,19224.9943606557,17149.5573770492,1053.7513907702,27140.168852459,17220.9472786885
110,550,9005.2131147541,383.9937579276,61994.106557377,106751.630967213,13514.262295082,746.2179005263,42984.4983606558,64147.0733934426,16509.6803278689,650.1557055149,33979.7934426229,20348.3276557377,17636.5081967213,936.1630106332,32117.306557377,23076.5144590164,14541.9180327869,2804.2695750414,40039.3770491803,29381.2578032787
130,650,9031.3606557377,362.571900032,73081.3918032787,134146.073196721,13212.8196721311,697.9028011167,51024.2737704918,77957.3243770492,16202.8524590164,656.0559899678,40900.4983606557,27040.2254098361,18062.5573770492,1279.5387003432,37238.6868852459,25002.5473278688,17503.2786885246,1440.2490022181,38796.3524590164,29969.6093278688

假设我想要一个 (x,A)-plot(最终有一条线表示 8,一条线表示 16,一条线表示 32,...)。

如何跳过前两行以获取实际数据? 我试过了

plot filename.".csv" u 2:3 every ::3 lc rgb "#00E80000" title "8"

但这仍然给了我

"plot_this.p", line 16: warning: Skipping data file with no valid points

plot filename.".csv" u 2:3 every ::3 lc rgb "#00E80000" title "8"
                                                                 ^
"plot_this.p", line 16: x range is invalid

gnuplot 默认使用空格作为文件中数据列的分隔符。 在尝试使用 gnuplot 绘制 CSV (comma-separated) 数据文件之前,您需要 运行:

set datafile separator ','

完成之后,您的第一个 plot 命令效果很好。 Gnuplot 在处理 CSV 列 headers.

方面相当智能