Gnuplot:找到给定y的x值

Gnuplot:找到给定y的x值,gnuplot,Gnuplot,我想这样做: 但是在gnuplot中(没有乳胶材料)。 我该怎么做 这是我的plt文件: reset set xlabel "Distance [kpc]" set ylabel "Velocity [km/s]" unset key set grid f(x)=m*x+b set xrange [0:10] set yrange [10:] set xtics set xtics nomirror set ytics nomirror set logscale y fit f(x) "vd.d

我想这样做: 但是在gnuplot中(没有乳胶材料)。 我该怎么做

这是我的plt文件:

reset
set xlabel "Distance [kpc]"
set ylabel "Velocity [km/s]"
unset key
set grid
f(x)=m*x+b
set xrange [0:10]
set yrange [10:]
set xtics
set xtics nomirror
set ytics nomirror
set logscale y
fit f(x) "vd.dat" u 1:2 via m, b
plot f(x) lw 2 lc rgb"black"
set term png
set output "~/uni/J2017+0603/J2017+0603_sim_pm_modified.png"
show output
plot f(x) lw 2 lc rgb"black"
这是输出:

我想知道,例如,哪段距离是87公里/秒。
我在gnuplot上画一条从87km/s到图形的水平线,然后垂直向下到x轴并显示结果。

过程与您给出的链接中所述的相同:找到函数的倒数并添加结果

函数的倒数是
(f(x)-b)/m
。要显示结果,请使用
设置箭头
,使用
图形
坐标系点击轴,然后使用
首先
获取实际交点的坐标

要在轴上添加结果,请使用
set xtics add
set ytics add

示例脚本(不带配件零件):

reset
set xlabel "Distance (kpc)"
set ylabel "Velocity (km/s)"
set grid

m = 234; b = 1
f(x)=m*x+b
set xrange [0:10]
set yrange [10:]
set tics nomirror
set logscale y

set samples 1000
y = 2000.0

set arrow from graph 0, first y to first (y-b)/m,y nohead lt 3
set arrow from first (y-b)/m, y to first (y-b)/m, graph 0 nohead lt 3
set ytics add (sprintf("%.f", y) y)
set xtics add (sprintf("%.2f", (y-b)/m) (y-b)/m)
plot f(x) lw 2 lc rgb"black"