开发者

How to draw a line plot with Gnuplot?

My file reads:

user_number     diff    id  
1                3      1  
1                4      1  
2                7      1  
359              8      1  
857              9      1  

Here are the command I used and the resulting error:

gnuplot> plot "avg_max_min.csv" using 1:2 with boxes  

                                           ^
Error:      warning: Skipping data file with no v开发者_开发百科alid points  
                                                    ^
             x range is invalid  

Any idea about where the error comes from?


To let it works you should change you data file to be

    #user_number     diff    id  
    1                3      1  
    1                4      1  
    2                7      1  
    359              8      1  
    857              9      1  

Gnuplot will treat lines begin with # as comments and will not use at to plot.


As pointed out in one of the comments, what you propose works without problems in the latest versions of Gnuplot.

There's also the possibility of telling Gnuplot to start to process the file at the second line, skipping the first:

plot 'avg_max_min.csv' every ::2 using 1:2 with boxes
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜