【发布时间】:2020-06-20 20:22:12
【问题描述】:
我在 Gnuplot 中用 fsteps 函数绘制了一个图形(X 上轴,Y 下轴)。接下来,我尝试将错误栏作为阴影区域(透明)添加到图表中,但无法将其绘制在图表上。以下是到目前为止我尝试过的代码并附上了图表。
#!/usr/bin/gnuplot
reset
set border lw 30
set term pngcairo size 10000,10000 font "arial-Bold,130"
set output 'out.png'
unset key
set size ratio 1.2
set style data lines
set xtics format ""
set x2tics nomirror
set ytics out nomirror
set ytics 0,20
set x2label "Vs (km/s)" offset -1.0
set ylabel 'Depth (km)' offset 1.5
set xrange [2.5:4.8]
set yrange [314:0]
set label 3 at 2,120
set key samplen 1.7 at 3.0,135
#
set label 1 '(a)' font "arial-Bold,130" at 0.8,15 right
set label 3 "C3 (MNAI)" center font "arial-Bold,130"
set style fill transparent solid 0.25
set style fill noborder
plot 'MAN.inmd' lc rgb 'blue' lw 35 title "Initial model" with fsteps,\
'MAN.outmd' using 1:2 lc rgb 'red' lw 35 dt"-" title "Inverted model" with fsteps ,\
'MAN.outmd' using 1:($2-$3):($2+$3) with filledcurve lc "blue" notitle,
文件 MAN.outmd X Y Z(Error) 的示例数据
0 3 0
0.4475 3.1 0
0.4475 3.5 0
2.6738 3.6 0.0552
2.6738 5 0.0552
3.8441 5.1 0.0592
3.8441 8 0.0592
3.6302 8.1 0.0395
3.6302 15.935 0.0395
4.5176 15.1 0.041
4.5176 113.296 0.041
4.2443 113.3 0.1024
4.2443 214 0.1024
4.4584 214.1 0.1077
4.4584 314 0.1077
我希望输出应如下所示(示例)
【问题讨论】:
-
您的代码是/不完整,我猜在第一个绘图命令行中可能缺少
using 1:3。你能检查并纠正吗?顺便说一句,您确定需要 10000x10000 像素分辨率吗?你想填满哪个区域?$2和$3之间的曲线? -
文件 MAN.outmd 有三列。 X 值、Y 值和 Z 标准误差。对于这个 XY 值,我想将误差绘制为阴影区域。
-
什么是 Z 列,x-error 或 y-error?如果是 y 误差,你想如何对垂直线进行着色?如果是 x-error,你想如何对水平线进行着色?您能否提供一些示例数据?也许你真正想要的手绘草图?
-
@theozh 我已经编辑了我的问题。这是一个 x 错误
标签: gnuplot