Gnuplot、多点重叠图例条目
我试图将反函数的图形绘制为y=xe^x,其中y=-1上方的图形为实线,下方为虚线。我想分别标记实线和虚线,但它们显示在彼此的顶部。我怎样才能避开这件事 这是我的密码:Gnuplot、多点重叠图例条目,gnuplot,legend,Gnuplot,Legend,我试图将反函数的图形绘制为y=xe^x,其中y=-1上方的图形为实线,下方为虚线。我想分别标记实线和虚线,但它们显示在彼此的顶部。我怎样才能避开这件事 这是我的密码: set multiplot set parametric set style arrow 1 head filled size char 1.5,20,50 set arrow 1 from -4.1,0 to 4.1,0 heads set arrow 2 from 0,-4.1 to 0,4.1 heads set
set multiplot
set parametric
set style arrow 1 head filled size char 1.5,20,50
set arrow 1 from -4.1,0 to 4.1,0 heads
set arrow 2 from 0,-4.1 to 0,4.1 heads
set trange[-4:4]
set xrange[-4:4]
set yrange[-4:4]
set xlabel "x"
set ylabel "y"
unset border
set xtics axis format " "
set ytics axis format " "
set arrow from -exp(-1),-1 to -exp(-1),0 nohead lt 3
set arrow from -exp(-1),-1 to 0,-1 nohead lt 3
set label "$e^{-1}" at -exp(-1),0.2
set label "-1" at 0.1,-1
plot [-1:4] t*exp(t),t title '$W_{0}(x)'$ lt rgb "black"
plot[-4:-1] t*exp(t),t lt 3 title '$W_{-1}(x)$'
这就产生了这个数字:
它们出现在彼此的顶部,因为您要打印两次(即使用
plot
命令两次)。尝试以下条件打印:
plot [-4:4] t*exp(t),(t < -1 ? t : 1/0) title '$W_{0}(x)$' lt rgb "black", \
t*exp(t),(t > -1 ? t : 1/0) lt 3 title '$W_{-1}(x)$'
plot[-4:4]t*exp(t),(t<-1?t:1/0)标题“$W{0}(x)$”lt rgb“黑色”\
t*exp(t),(t>-1?t:1/0)lt 3标题“$W{-1}(x)$”
您不需要使用上面的multiplot