Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
389 views
in Technique[技术] by (71.8m points)

rotating and justifying tics in 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:

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...