Gnuplot:对数轴中的三角形

时间:2014-12-07 13:45:42

标签: gnuplot

我想在loglog比例中绘制一个与斜线平行于曲线斜率的直角三角形。但是,gnuplot表现得很时髦:

set terminal postscript eps enhanced "Helvetica" 22

a1 = 64459.7;
a2 = -1.90748;

func(x) = a1*x**a2 

X1 = 1e+4;
Y1 = 1e-4;
X2 = 2e+4;
Y2 = Y1 + func(X1) - func(X2)

set logscale xy
set format x "10^{%T}"
set format y "10^{%T}"
set key top right 
set output 'temp.eps'

set object 1 poly from X1,Y1 to X2,Y1 to X1,Y2 to X1,Y1 fs empty border 1
set xrange [0.8e+4:1e+5]

plot func(x) title sprintf("a line with slope %1.2f",a2)

unset object 1

和输出 enter image description here

在{-1}}范围内,命令set object的行为可能在log-log比例中有所不同,否则我不知道......

1 个答案:

答案 0 :(得分:1)

正确的答案是:

Y2 = Y1 * 10**(a2 * log10(X1 / X2) );

P.S。主持人,随时删除问题