在GNUplot步进图中添加点
在GNUplot步进图中添加点,gnuplot,Gnuplot,我有个问题。我正在使用带有以下代码的GNUplot: set terminal png set title 'Assembly ID A047457' set key autotitle columnhead set xlabel 'axial coordinate [cm]' set ylabel 'signal intensity [n/cm]' set output "output/assembly_001.png" plot 'data_gnuplot/001.txt' with st
我有个问题。我正在使用带有以下代码的GNUplot:
set terminal png
set title 'Assembly ID A047457'
set key autotitle columnhead
set xlabel 'axial coordinate [cm]'
set ylabel 'signal intensity [n/cm]'
set output "output/assembly_001.png"
plot 'data_gnuplot/001.txt' with steps notitle
我有很好的输出,我想在角落里添加点,我不知道,如何添加它们。我只能在左角添加点。你能帮我吗
和我的数据文件:
A047457
0 0.1942
5 0.3426
10 0.528
20 0.642
34 0.858
53 0.938
68 0.947
84 1.041
96 0.912
118 0.85
179 0.585
183 0.498
185 0.473
186 0.433
189 0.348
195 0.266
196 0.202
198 0.142
199 0.098
如果我正确理解了你的问题,你想把这些点放在各个角落 只需用y值“延迟”1再次绘制数据。您可以通过串行求值来实现这一点(检查帮助运算符二进制文件)。 在第三个绘图命令中
(y0=y1,y1=2,y0)
开始时为y1=NaN
,然后为y0=y1
,然后为y2=$2
(数据的当前y值),但实际绘制的是y0
。因此,每个y值都延迟一次
代码:
### placing point at all corners of a step plot
reset session
$Data <<EOD
A047457
0 0.1942
5 0.3426
10 0.528
20 0.642
34 0.858
53 0.938
68 0.947
84 1.041
96 0.912
118 0.85
179 0.585
183 0.498
185 0.473
186 0.433
189 0.348
195 0.266
196 0.202
198 0.142
199 0.098
EOD
y1=NaN
plot $Data u 1:2 w steps lw 2 lc rgb "red" notitle, \
'' u 1:2 w p pt 7 lc rgb "blue" notitle, \
'' u 1:(y0=y1,y1=$2,y0) w p pt 7 lc rgb "blue" notitle
### end of code
####将点放置在阶梯图的所有角落
重置会话
$Data