gnuplot学习笔记

来源:互联网 发布:淘宝如何加入消保 编辑:程序博客网 时间:2024/06/05 08:44

先扔两个个人认为比较有用的references:

http://blog.chinaunix.net/u3/109940/showart_2215499.html

http://blog.chinaunix.net/u/18816/showart_152237.html

 

还有就是找到一个可以实时输出plot的一个perl代码的网站:http://users.softlab.ntua.gr/~ttsiod/gnuplotStreaming.html

 

下面是我看gnuplot doc的时候做的一些笔记:

1. 3 types of plot cmds:
    plot --> 2D plot
    splot --> 3D plot
    replot --> appends the arguments to the previous plot or splot.

    general invocation:
    plot {<range>} {<iteration>}
        <function>|"<datafile>" {file-modifier}
        {<axes>} {<title-spec>} {with <style>}
        , ....
    ;; using comma to separate different functions.

    several keywords:
    volatile -> the data read in will change in the future, so if gnuplot
want the reproduce the same plot as before, it will use the data already read
in instead of re-read again the data.

2. comments: # precedes the actual comment.

3. coordinates of plot:
    {<system>} <x>,{<system>} <y> {,{<system>} <z>}
    system --> first: uses left and bottom axes
          `--> second: uses top and right axes
          `--> graph: specifies the area within the axes, ranging from
          |        0 to 1.
          `--> screen: whole area of the screan(Windows).
          `--> character: coor in char's width and height.

4. expression: any expr accepted by C, FORTRAN, Pascal or BASIC is valid. White space in between will be ignored.
    complex number: {<real>, <imag>}  e.g: {1, 2} ==> 1 + 2i
    string containing numerical value will be converted to the corresponding numerical value. e.g: "12" + 1 ==> 12 + 1

5. function: same as the unix C math lib, but accepting real, integer and complex number.

6. operators: same as the C ops.
    ** ==> square operator
    , ==> serial eval, return the right most expr.
         e.g: (a, b) # first eval a, then b.
    . ==> string concatenate e.g: a.b
    eq ==> string eq
    ne ==> string ne

7. line type: when plotting, you can specify the line type the plot uses.
    e.g: plot sin(x) linetype 4
         plot sin(x) lt -1
    specify the line color
    e.g: plot sin(x) linecolor 3
         plot sin(x) lc 3

8. string var: var = "hello"
    substr ==> var[2:3] [begin:end]
    var[:] or var[*:*] ==> whole string.

9. data file: data file containing point or other things can be used in plots'
cmd. Each field should be separated by white spaces.

    Specifying the reading format of the data file:
    plot 'file' using {<entry> ...} {'format'}
    ;; if the format field if specified, each line(record) will be parsed
by the C library's scanf function, with the specified format string.

10. execute commands contained in the file
    gnuplot file1 file2 ...
    execute the commands in the files in the specified order, and exit
afterwards.