Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rotating and justifying tics in gnuplot

Tags:

gnuplot

I want to rotate the xtics by 45 degree. In another word the direction is /. Problem is the tics will appear inside the chart area, I want to put them outside of chart. See the figure:

like image 395
mahmood Avatar asked Oct 17 '13 11:10

mahmood


1 Answers

You must adjust both the alignment (can be right, center or left) and the offset (x,y coordinates with respect to the default tics position) of the xtics.

Here is an example, which demonstrates the three different possiblities. The offset must be adjusted manually, in order to get it right:

set xrange [0.5:3.5]
set bmargin 5
set multiplot layout 1,3

set xtics ('first' 1, 'second' 2, 'third' 3) rotate by 45 right
set title 'right aligned'
plot x

set xtics center offset 0,-1
set title 'centered'
replot

set xtics left offset 0,-2
set title 'left aligned'
replot
unset multiplot

This gives (with 4.6.4):

enter image description here

like image 142
Christoph Avatar answered Sep 19 '22 17:09

Christoph