关于图:Gnuplot:在一张图中绘制来自不同来源的结果

Gnuplot: plotting results from different sources in one graph

我正在尝试使用gnuplot比较来自不同协作的测量结果。理想情况下,该图应如下所示:

Example


我展示了两种方法,具体取决于您的数据文件。两种可能的结构是data01.dat

1
2
3
4
5
# data01.dat
alpha  error
 1.0    0.2
 2.0    0.2
 1.5    0.2

data02.dat

1
2
3
4
5
# data02.dat
Collab alpha error
   1    1.0   0.2
   2    2.0   0.2
   3    1.5   0.2

使用data01-structure

1
2
3
4
5
6
7
8
9
10
11
12
13
reset
set encoding utf8
set terminal wxt size 480,600 font"Times New Roman,10"
set tics out nomirror
set xlabel"{/:Italic=12 ?±}"
set link y2
unset ytics
set y2range [:] reverse
set y2tics 1
set format y2"Collaboration %g"
set offsets graph 0.1, 0.1, 0.5, 0.5

plot"data01.dat" u 1:0:2 w xerrorbars pt 7 not

使用data02-structure几乎都是相同的,除了plot命令。

1
plot"data02.dat" u 2:1:3 w xerrorbars pt 7 not

结果。

Graph

我希望会有用。