gnuplot:用X和Y线注释绘图

gnuplot:用X和Y线注释绘图,gnuplot,Gnuplot,我想画y=xe^x的倒数,虚线指向点-exp-1,-1 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 yla

我想画y=xe^x的倒数,虚线指向点-exp-1,-1

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 " "

plot [-4:0.999] log(1-t)/t, t

plot [-4:4] t*exp(t), t lt rgb "black" title '',  -exp(-1),t lt rgb "black", t, -1 lt rgb "black" 
我想限制垂直线从y=-1到y=0,水平线从x=-exp-1到x=0。如何做到这一点

此外,是否有一种更简单的方法来设置所有绘图的线颜色,而不是为每个绘图指定线颜色


我明白了,如果我理解正确的话,你基本上需要用虚线来标注你的图形,所以为什么不也用箭头来标注呢

例如:

# I'm using pngcairo dashed terminal
set terminal pngcairo dashed
set output 'graph.png'

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 " "

#plot [-4:0.999] log(1-t)/t, t

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

plot [-4:4] t*exp(t),t  lt rgb "black" title ''

就您对线路颜色的疑问而言,它还取决于您使用的终端类型。例如,对于pngcairo终端,Gnuplot本身将为绘图指定不同的线型。如果你想要特定的颜色,当然你必须说明它们。看一看。你只需在Gnuplot的线型/线颜色/线型等上进行简单搜索,就能找到大量信息。

你的意思是你想分别在-exp-1:0和-1:0之间缩放x轴和y轴,还是其他什么?@ZahaibAkhtar我更新了我的帖子,并添加了一个指向我的绘图图像的链接,因为我不确定我是否理解了你的问题。我希望水平虚线从y=-e^-1限制到y=0,垂直虚线从x=0限制到x=-1。