如何在 gnuplot 的 x 方向上创建一个填充区域?
How can I make a filled region in the x direction in gnuplot?
我知道 gnuplot 有很好的绘图类型 filledcurve,你可以在两条曲线之间创建一个填充区域,如 1:2:3,它会在列 $2 和 $3 之间创建一条曲线相同的 x 值 $1。但是我怎样才能在 gnuplot 的下图中填充这个区域呢?范围在 x 方向,如 x1:x2:y,与 y 的值相同。
我的数据格式如下:
# rho1 rho2 C
0.8022651311239721 0.8299444680667378 0.00005011872336272725
0.8022624676512962 0.8299464715046031 0.00004466835921509635
0.8022618998639025 0.8299490455369624 0.000039810717055349695
0.8022533810411624 0.8299390462160209 0.000035481338923357534
...
不过我也可以把它分成两个档案。
这是一个有用的技巧,它使用 3D 绘图样式 with zerror
,然后设置视角,使其看起来像 2D x/y 绘图。我没有足够的数据来复制你显示的图,所以我使用垃圾数据文件只是为了显示图的工作原理:
# 3D plot style "with zerror" takes 5 columns of input
# x y z zlow zhigh
# We will choose a view angle such that "z/zlow/zhigh" is the horizontal axis
# "x" is the vertical axis
# "y" is unused because it is along the line of sight
# For your data as described
rho1 = 1 # column 1
rho2 = 2 # column 2
c = 3 # nominal y value, we use it for X
junk = 0 # unused constant coordinate
rhomean(c) = (column(rho1) + column(rho2)) / 2.
set view 270, 0
set view azimuth -90
unset ytics
set zlabel "ρ" # horizontal axis in this projection
set xlabel "C" # vertical axis in this projection
set zrange [0:50] # Note how this affects the horizontal axis!
splot "data" using c:(junk):(rhomean(c)):rho1:rho2 with zerror lt black fc "gold"
with zerror
绘图样式和 set view azimuth
命令都需要合理的当前版本的 gnuplot。
我知道 gnuplot 有很好的绘图类型 filledcurve,你可以在两条曲线之间创建一个填充区域,如 1:2:3,它会在列 $2 和 $3 之间创建一条曲线相同的 x 值 $1。但是我怎样才能在 gnuplot 的下图中填充这个区域呢?范围在 x 方向,如 x1:x2:y,与 y 的值相同。
我的数据格式如下:
# rho1 rho2 C
0.8022651311239721 0.8299444680667378 0.00005011872336272725
0.8022624676512962 0.8299464715046031 0.00004466835921509635
0.8022618998639025 0.8299490455369624 0.000039810717055349695
0.8022533810411624 0.8299390462160209 0.000035481338923357534
...
不过我也可以把它分成两个档案。
这是一个有用的技巧,它使用 3D 绘图样式 with zerror
,然后设置视角,使其看起来像 2D x/y 绘图。我没有足够的数据来复制你显示的图,所以我使用垃圾数据文件只是为了显示图的工作原理:
# 3D plot style "with zerror" takes 5 columns of input
# x y z zlow zhigh
# We will choose a view angle such that "z/zlow/zhigh" is the horizontal axis
# "x" is the vertical axis
# "y" is unused because it is along the line of sight
# For your data as described
rho1 = 1 # column 1
rho2 = 2 # column 2
c = 3 # nominal y value, we use it for X
junk = 0 # unused constant coordinate
rhomean(c) = (column(rho1) + column(rho2)) / 2.
set view 270, 0
set view azimuth -90
unset ytics
set zlabel "ρ" # horizontal axis in this projection
set xlabel "C" # vertical axis in this projection
set zrange [0:50] # Note how this affects the horizontal axis!
splot "data" using c:(junk):(rhomean(c)):rho1:rho2 with zerror lt black fc "gold"
with zerror
绘图样式和 set view azimuth
命令都需要合理的当前版本的 gnuplot。