我在多图中有两个图,在第二个图上,刻度号标签没有出现,我想在底部X轴上显示
#!/usr/bin/gnuplot
reset
set border lw 30
set term pngcairo size 10000,10000 font "arial-Bold,130"
set output 'out.png'
set multiplot layout 2,2
unset key
set size ratio 1.2
set style data lines
set xtics format ""
set x2tics nomirror
set ytics out nomirror
set ytics 0,20
set x2label "Vs (km/s)" offset -1.0
set ylabel 'Depth (km)' offset 1.5
set xrange [0:5]
set yrange [200:0]
set label 3 at 2,120
set key samplen 1.7 at 3.0,135
#
set label 1 '(a)' font "arial-Bold,130" at 0.8,15 right
set label 3 "C3 (MNAI)" center font "arial-Bold,130"
plot 'MAN.inmd' lc rgb 'blue' lw 35 title "Initial model" with fsteps,\
'MAN.outmd' lc rgb 'red' lw 35 dt"-" title "Inverted model" with fsteps ,
unset x2label
unset x2tics
unset ylabel
unset ytics
#
set size ratio 0.9
set xlabel
set xtics 5
set ytics 0.5
set xlabel "Period (s)" offset 2.5
set ylabel "Group Velocity (km/s)" offset 2.5
set xrange [15:45]
set yrange [3:4.5]
set label 3 at 30,3.5
set label 4 at 18,4.3
set label 5 at 20,4.0 font "arial-Bold,130"
set key right bottom samplen 0.9
#
set label 3 "C1 (MNAI)" center font "arial-Bold,130"
set label 5 "Rayleigh wave dispersion curves" font "arial-Bold,130"
set label 4 "(a)" center font "arial-Bold,97"
plot 'MANdsp.out' lc rgb 'red' lw 35 title "Model fit dispersion curve",\
'mandsp.in' lc rgb 'blue' lw 35 dt"-" title "Observed dispersion curve" smooth acsplines,
unset multiplot
刻度线出现在X轴上,但刻度线没有出现在X轴底部标签上。我也尝试了其他方法,但无法克服它
答案 0 :(得分:0)
关于xtics,您需要执行以下操作:
...
set xtics format "" # Don't print x-axis bottom tic labels!!!
...
set x2tics nomirror # Print x2tics, tic labels are included by default.
...
...# First plot # -> You see x2 tic labels.
...
unset x2tics # Don't print x2 tics
...
set xtics 5 # Print x-axis tics, but keep empty tic labels.
...
...# Second plot # -> no x2 tics; xtics are printed without labels.
您可以使用以下方法重置x轴tic标签的默认格式:
set xtics 5 format "% h"
有关其他格式选项,请参见help set format
。