Everyone of us in academic environment needs to create some high resolution plots for our academic articles, reports, or thesis now and then. There are many nice free or paid softwares out there. I  prefer to use free software such as gnuplot. One useful feature of gnuplot is the ability to insert latex into the graph or labels, etc. I should mention that MatLab has this feature, as well. Additionally, it creates figures with “eps” extension.

Here, I just write some sample syntax on how to make a plot in gnuplot:

1) to set a x or y label, choose a font and size
set xlabel “time(ns)” font “Helvetica, 20”
The above syntax, put a label for x axis as time(ns)
2) to write latex in the label
set ylabel ‘{/Symbol r}’_R(t)
The above syntax, put label for y axis as \rho_R(t)
3) to create some plots on one file
set multiplot
4) to choose linecolore, and lind width
Plot “/filename.dat” with linestyle ls 2 lw 4
This syntax make a plot from given file, with red color and linewidth 4 pt.
5) to remove legend or anything else
unset key
unset xlabel, xtics, etc
6) to make legend
set key
7) to change x or y tics font and fontsize (sometimes it happens that after I specify the font, the tics will disappear for no good reason. So, use xrange or yrange to specify range of x or y)
set xtics font “Times-Roman, 20”
8) to set range for x or y
set xrange [1:100]
Your plot will look like this:

One thought on “Gnuplotting.

  1. Pingback: A quick guidelines for preparation of writing your thesis. | didgaha

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s