Wednesday, May 6, 2020

Gnuplot - Tics

Some information regarding Tics is listed in this blog.  We use the following table 'num2.dat'
 
Row    Col1 
Row1    2
Row2    4
Row3    -2
Row4    3

By default, xtics and ytics will denote the position. We can make one of the column display the corresponding values on the x-axis.
Xtics

We can pass different values to the positions from the script.  The syntax is 

set xtics (“<label>” <pos>, …….)

Example for either xtics/ytics are:

set ytics ("Zero" 0, "Four" 4)
set xtics ("NewOne" 1, "NewFour" 4)
plot 'num2.dat' using 2

The graph would look like:

Tics - Script Defined
Tics - Script Defined
In any case, the space is not sufficient to display the xtic label, we can rotate the text by mentioning the degree, either clockwise(use minus symbol before degree) or anticlockwise.  We use the command 'rotate by'.

Tics 'Rotate by'

'offset 0,-1.5' means how much we deviate by x-axis and y-axis from its default position.  If we dont use it, the display would be on the line.  Just a minor adjustment.

No comments:

Post a Comment