| Home |

Library -- Gnuplot Examples


  1. Let's get started...
  2. gnuplot+
  3. Gnuplot3.6beta
  4. Gnuplot3.7
  5. Print it out to PS printer
  6. Examples

I love Gnuplot.

  1. To get started, just type
    gnuplot [script-filename]
    Or if you are a beginner, after going into gnuplot (without filename), type
    help plot
    then you will see some explanations.
    One of the simplest sample is the following.

    % gnuplot	
    G N U P L O T +
    unix version 3.5
    ...
    gnuplot> plot sin(x)
    gnuplot> quit
    


  2. (Obsolete) In nucl and hadron, gnuplot3.5+ is installed.,
    Our version of gnuplot3.5+ is
    gnuplot3.5+gnufit1.2+Yamaga(plus)+Ono extension(unofficial).
    Its command name is just "gnuplot". Ono@Tohoku-U. version contains some extension for superscript and subscript, greek letters and so on. Its usage is similar to that of Ngraph (such as "^12@C" for 12C). Gnuplot+ (Yamaga extension) also treats super- and sub-script, greek letters, and so on. Its usage is similar to LaTeX.

  3. Gnuplot3.6beta is also installed in nucl, with the name "gp363" (gnuplot3.6beta315+) and "gp364" (gnuplot3.6beta325). It supports greek letters, super- and sub-scripts by default. (See "help postscript" for detail.)
    The figure below is a sample output of gnuplot3.6. (You can also get similar output with our gnuplot3.5.) The horizontal axis is the type of points, and the vertical axis is the type of lines. (They are not K+ momentum etc.!!) The script file is here, and its output PS file is here.

  4. Gnuplot3.7 is recently opened for public. It is available with the name "gnuplot3.7". It is almost the same as gnuplot3.6beta345 or later, but the relation between the linetype and color is different.

    Gnuplot3.7 Result Gnuplot3.6 Result

    The script file is here, and its PS output is here for gnuplot3.7 and here for gnuplot3.6.

  5. In order to print out, you can type in gnuplot or write the following two lines in the script file.
    set term postscript
    set output "YOUR-OUTPUT-FILE-NAME"
    and plot the figure. Then the figure is saved in the PS file which you specified.

    You can put Greek and other character or symbols in postscript. Guide is here.

  6. Now, I have some EXAMPLES. The first one is 3-d plot, and the second one is a naive way of plot multi-figures in one plot.
  7. For special characters in postscript, please search for it in the "docs/psdocs/ps_guide.ps" in the gnuplot package.
  8. I have two complains on the default version of gnuplot. One is that the dash length is too short, and the second is that with "hist", gnuplot set both of the end points to zero, which is not always true especially in log plot. Then I usually use the following unofficial patch to make it my favorite.


| Home |


Akira Ohnishi <ohnishi@nucl.sci.hokudai.ac.jp>