| Home |
gnuplot [script-filename]Or if you are a beginner, after going into gnuplot (without filename), type
help plotthen you will see some explanations.
$ gnuplot G N U P L O T Version 4.0 patchlevel 0 .... Terminal type set to 'x11' gnuplot> help plot `plot` is the primary command for drawing plots with `gnuplot`. ... Syntax: plot {One of the simplest sample is the following.} { | {" " {datafile-modifiers}}} ... gnuplot> quit $
$ gnuplot G N U P L O T Version 4.0 patchlevel 0 .... Terminal type set to 'x11' gnuplot> plot sin(x) gnuplot> quit $
The figure below is a sample output of gnuplot4.0. 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 EPS file is here.
Line and point color is specified by the linetype.
linetype(lt)-color and lt-dash correspondence in gnuplot 4.0 | ||||||||||
lt | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | lt>10 |
color | red | green | blue | magenta | lightblue | yellow | black | orange | grey | color @ mod(lt-1,9)+1 |
dashed type | solid | dashed | short dashed | dotted | dot dashed | dot short dashed | ... | ... | ... | dash @ mod(lt-1,9)+1 |
The above number-color correspondence in gnuplot-4.0 is the same in gnuplot-3.7. But the "linestyle" in 3.7 has to be replaced with "style line".
set linestyle 1 lt 1 lw 6 # in gnuplot 3.7 script set style line 1 lt 1 lw 6 # in gnuplot 4.0 script
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.
Interactive Session Example | Script Session Example |
$ gnuplot gnuplot> set term postscript gnuplot> set output "YOUR-OUTPUT-FILE-NAME" gnuplot> plot ... gnuplot> quit $ lpr YOUR-OUTPUT-FILE-NAME |
$ gnuplot sin.plt $ lpr sin.pswith a test gnuplot script (sin.plt) as, set term postscript eps color enh "Times-BoldItalic" set title "sin(x)" set output "sin.ps" plot sin(x) |
# 1st step set term "table" set output "temp.dat" splot .... # 2nd step set output "temp.eps" plot "temp.dat" using 1:2 with lines
NX=1; NY=3 DX=0.25; DY=0.25; SX=0.8; SY=0.6 set bmargin DX; set tmargin DX; set lmargin DY; set rmargin DY set size SX*NX+DX*1.5,SY*NY+DY*1.8 set multiplot # First Figure set size SX,SY set origin DX,DY ; plot .... # Second Figure set origin DX,DY+SY ; plot .... # Third Figure set origin DX,DY+SY*2 ; plot .... unset multiplot
In this figure, I applied another trick.
In making color PS figures, we cannot control
color and dashed type separately.
I.e., when we select solid (set term post solid ...),
all the lines become solid,
and when we select dashed (set term post dashed ...),
red line is solid, green line is dashed, and blue line becomes dotted.
(In the next version of gnuplot,
gnuplot-4.1 or current CVS version,
we can select "red-dotted" or "blue-solid".)
At present, I MODIFY the eps file itself.
Default (black, dashed): /LT6 { PL [2 dl 2 dl 2 dl 4 dl] 0 0 0 DL } def --> Modified (black, solid): /LT6 { PL [] 0 0 0 DL } defWell, it would be easy in stream editor, sed.
sed -f LT6-solid.sed Esurf.eps > Esurf-1.eps mv -f Esurf-1.eps Esurf.epswith a sed script (LT6-solid.sed),
s/\/LT6 { PL \[2 dl 2 dl 2 dl 4 dl\] 0 0 0 DL } def/\/LT6 { PL \[\] 0 0 0 DL } def/
package |
| Home |