答案 0 :(得分:0)
我不知道可以执行此操作的直接Gnuplot功能,但是可能会使用一些解决方法。
例如,可以在零位置取消设置tic,而是在那里放置一个自定义标签:
set terminal pngcairo enhanced font ",14"
set output 'fig.png'
set multiplot
xMin = 0
xMax = 2*pi
set xr [xMin:xMax]
set yr [-1:1]
set xtics out nomirror
set ytics out nomirror
set ytics add ("" 0)
set label "0" at xMin,0 offset char -1.5,0 right textcolor rgb "blue"
plot sin(x) w l t 'sin(x)'
或者,可以使用基于multiplot
的技术,其中策略基本上首先绘制感兴趣的函数/数据,而不将tic置于零位置,然后将其覆盖为空的但是对于位置零处的定制tic:
set terminal pngcairo enhanced font ",14"
set output 'fig.png'
set xr [0:2*pi]
set yr [-1:1]
set xtics out nomirror
set ytics out nomirror
set ytics add ("" 0)
plot sin(x) w l t 'sin(x)'
set lmargin at screen GPVAL_TERM_SCALE * GPVAL_TERM_XMIN / (1.*GPVAL_TERM_XSIZE)
set rmargin at screen GPVAL_TERM_SCALE * GPVAL_TERM_XMAX / (1.*GPVAL_TERM_XSIZE)
set bmargin at screen GPVAL_TERM_SCALE * GPVAL_TERM_YMIN / (1.*GPVAL_TERM_YSIZE)
set tmargin at screen GPVAL_TERM_SCALE * GPVAL_TERM_YMAX / (1.*GPVAL_TERM_YSIZE)
unset border
unset key
unset xtics
unset ytics
set ytics ("0" 0) out nomirror textcolor rgb 'blue'
plot 1/0