rotating and justifying tics in gnuplot

前端 未结 1 1741
北荒
北荒 2020-12-15 22:47

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 o

相关标签:
1条回答
  • 2020-12-15 23:50

    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

    0 讨论(0)
提交回复
热议问题