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 steps notitle

我有很好的输出,我想在角落添加点,我不知道如何添加它们。我只能向左角添加点。你能帮我一下吗?

This is what I need

This is my output

还有我的数据文件:

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 值都会延迟 1。

代码:

### 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

结果:

enter image description here

关于gnuplot - 在 GNUplot 阶梯图中添加点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59799108/

相关文章:

wolfram-mathematica - Gnuplot 和 Mathematica 中的颜色图

gnuplot - 在 gnuplot 中将图例置于最前面

gnuplot:日期和时间在 x 轴的单独列中,对输入文件进行排序

bash - Gnuplot 自动绘制所有数据文件

plot - y 轴负值和正值的不同比例 - Gnuplot

python - 在 Sage 中使用 gnuplot 时出错,但在常规 Python 中工作正常

c++ - 为什么 _popen 在这里可以工作,而 boost::process 却不能?

height - 增加 gnuplot 输出的宽度和高度

plot - 在gnuplot中绘制两个轴

gnuplot - 使用 gnuplot 查找最接近零的值