Set Xtics Font "Times-Roman, 30"

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 5

set set zrange [-1.0:1.

0]
replot

My data files are in inconsistent formats. This one has five columns, tab
separated:
X, Y, top sensor, bottom, sensor gradient
dall.dat in ~/gnuplotstuff
There are some dropouts in the top and bottom sensor columns, but I
edited the gradient values, which
are OK now.

lines not symbols: http://lowrank.net/gnuplot/intro/style-e.html#lines

for example: \
http://lowrank.net/gnuplot/plot2-e.html
gnuplot> set terminal postscript enhanced "Helvetica" 16
gnuplot> set title "Damping Function" font "Times-Roman,40"
gnuplot> set xlabel "X-AXIS" font "Helvetica,20"
gnuplot> set ylabel "Y-AXIS" font "Times-Italic,32"
gnuplot> plot exp(-x)

font on axes
set xtics font "Times-Roman, 30"
Gnuplot: Simple Plotting
"gnu plot crash course" tells how to plot to a gif file
oops. Can't do this on a Mac.
gnuplot> set term gifgnuplot> set output ‘‘mygraph.gif’’

gnuplot> replot

draw to the screen again:

[if you have Mac] gnuplot> set term aqua[if you have Linux] gnuplot> set term x11

http://www.maths.manchester.ac.uk/~pjohnson/Gnuplot/gnuplot.pdf
Gnuplot is a freeware program available on the unix as well as MS Windows
system which can be used for plotting. To use it in a Unix-based operating
system, it is invoked by typing gnuplot in a shell window. This will give you
a prompt something like:
gnuplot>
To use it you can now type additional commands. For example there is an
extensive help facility, just type help. To exit type quit. You may also wish to
consult tutorials available on the internet- just search for gnuplot tutorial in
google. The following is one such guide
http://www.cs.uni.edu/Help/gnuplot/
In your work suppose you generate data in a le called results with the first
column giving x values, the second giving y values and the third column
giving y1 values. A simple plot of x versus y1 is generated with

plot ‘results’ u 1:3 w li


with the 1:3 representing the column numbers, 1 for xvalues and 3 for y1
values. Once you are satised with your plot, you can save the output in many
formats. For postscript output to a le say myplot.eps use
set terminal postscript eps
set output ’myplot.eps’
plot ’results’ u 1:2 w li
Finally, you can also write scripts and load these up. I have put an example
script on my website with example results. To load the script at the command
type:
load ’gnu.com’
Note that the statements beginning with a # denote comments.
1

Gnuplot: Contour Plotting


To plot contours in gnuplot the data must be stored in columns, with the
following format:
Notice that there is a single white line space inbetween changing for a new
value in the y coordinate. If we want to plot different sets of data in a single
file we may use a double white space. Different sets of data can then be
accessed using the index command, where data sets in a file are indexed from
0.
To plot a surface from this data, we can use
splot’results.dat’ using 1:2:3 with line
Another way to plot different sets of data would be to put it in a different
column.
In order to plot contours from a file of this format, the quickest way to view
contours is to issue the following commands:
set parametric
set contour base
set view 0,0,1
unset surface
set cntrparam levels 5
splot’results.dat’ using 1:2:3 with line
If you wish to produce better quality graphs you must convert the contours
into a data file and them print them using the plot command. To do this, we
issue the following commands before those listed above:
set terminal table
set output ’results.tab’
The file results.tab will now contain the data needed to plot just the contours.
You can now set up linestyles manually for each of the contours using the
index command to access each one. For example the command to plot the
.tab file may look something like:
set terminal postscript eps color solid enhanced
set output ’figure.eps’
set style line 1 lt 1 lw 3
p’results.tab’ i 0 w l ls 1,\
. x0  y0

. x1  y0

. x2  y0

..

xn y0 x0 y1

..

xn y1 . .

f(x0,y0) f(x1,y0) f(x2,y0)

. f(x ,y )
n 0

f(x0,y1) . f(xn,y1)

x0 ym f(x0,ym) . . .xn ym f(xn,ym)

’results.tab’ i 1 w l,\
’results.tab’ i 2 w l,\
’results.tab’ i 3 w l,\
’results.tab’ i 4 w l
2

You might also like