set xrange [0:590] gnuplot> set ylabel-6ren">
gpt4 book ai didi

linux - y 轴的值如何与 gnuplot 中形成的线一起打印?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:40:10 25 4
gpt4 key购买 nike

我使用了以下命令并获得了如下所示的图表。

gnuplot> set xlabel "Input (N)"
gnuplot> set xrange [0:590]
gnuplot> set ylabel "Time (secs)"
gnuplot> set yrange [0:0.5]
gnuplot> set title "MATRIX ADDITION-Sequential VS Parallel program run in Cluster"
gnuplot> set for [i=0:24] xtics (0,25*i)
gnuplot> plot 'madd.csv' using 1:2 with lines title "Sequential Program" \
lc rgb "blue" lw 4, 'madd_spp.csv' using 1:3 with lines \
title "Parallel Program " lc rgb "green" lw 4

Gnuplot output

现在我需要在使用 gnuplot 绘图后获得的线条中打印 y 轴的值。我将如何做到这一点?

最佳答案

您可以使用 gnuplot 的 labels风格:

plot 'madd.csv' using 1:2 with lines title "Sequential Program" \
lc rgb "blue" lw 4, '' using 1:2:2 with labels tc rgb "blue" notitle, \
'madd_spp.csv' using 1:3 with lines title "Parallel Program " \
lc rgb "green" lw 4, '' using 1:3:3 with labels tc rgb "green" notitle

如果标签与你的线条碰撞太多,你可以给它们一个偏移量:

plot 'madd.csv' using 1:2 with lines title "Sequential Program" \
lc rgb "blue" lw 4, '' using 1:2:2 with labels tc rgb "blue" notitle, \
'madd_spp.csv' using 1:3 with lines title "Parallel Program " \
lc rgb "green" lw 4, '' using 1:3:3 with labels tc rgb "green" offset 2 notitle

关于linux - y 轴的值如何与 gnuplot 中形成的线一起打印?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43691392/

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