gpt4 book ai didi

linux - 如何用风格线为每个点增加值(value)?

转载 作者:太空宇宙 更新时间:2023-11-04 11:46:03 25 4
gpt4 key购买 nike

我使用这个脚本 Gnuplot:

set title "df -m command test"
set terminal png truecolor size 720,480 background rgb "#eff1f0"
set output "/xxx/xxx/xxx/test.png"
set grid
set style line 1 \
linecolor rgb '#0060ad' \
linetype 1 linewidth 2 \
pointtype 7 pointsize 1.5
set offsets 0.5,0.5,0,0.5
set datafile separator ","
set ylabel " MB BLOCK "
set xlabel " Date "
set format y "%g"
plot "/xxxx/xxx/xxx/TEST.txt" using 2:xtic(1) with linespoints linestyle 1 title "MB used"

有了这些数据:

2019-08-28,384.00
2019-08-29,394.00
2019-08-30,354.00
2019-08-31,384.00
2019-09-01,484.00
2019-09-02,324.00
2019-09-03,384.00

要创建此图表: image_2
(来源:noelshack.com)

你能告诉我如何给每个点赋值吗?

最佳答案

这个呢?还要检查 帮助标签

代码:

### plot with values as labels at datapoints
reset session

$Data <<EOD
2019-08-28,384.00
2019-08-29,394.00
2019-08-30,354.00
2019-08-31,384.00
2019-09-01,484.00
2019-09-02,324.00
2019-09-03,384.00
EOD

set datafile separator ","
set offsets 0.5,0.5,20,20

myLabel(n) = sprintf("%g",n)
plot $Data u 2:xtic(1) w lp pt 7 lc rgb "blue" title "MB used", \
$Data u 0:2:(myLabel($2)) w labels offset 0,1.5 notitle
### end of code

结果:

enter image description here

关于linux - 如何用风格线为每个点增加值(value)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57727102/

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