gpt4 book ai didi

gnuplot - 在 GNUplot 步骤图中添加点

转载 作者:行者123 更新时间:2023-12-04 10:43:57 29 4
gpt4 key购买 nike

我有问题。我正在使用带有以下代码的 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 即可再次绘制数据。您可以通过串行评估来做到这一点(检查 help operators binary)。
在第三个绘图命令中 (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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com