gpt4 book ai didi

第一行点之前和最后一行之后的 gnuplot 水平空间

转载 作者:行者123 更新时间:2023-12-02 09:15:55 26 4
gpt4 key购买 nike

使用:gnuplot 4.2 补丁级别 6

我正在绘制烛台。当然,第一个和最后一个数据点位于左右 Y 轴条上。第一个和最后一个烛台几乎都被轴条隐藏了。啦啦:

set terminal gif
set xtics rotate
plot "test.csv" u 0:3:xtic(1) t "Avg" with lines, \
"test.csv" u 0:4:5:6:7 t "MinMax&Stdv" with candlesticks

enter image description here

有没有办法“伪造”一个空的起点和终点?我曾尝试添加零值,但这只是在开始和结束时将绘制的线作为基础。

最佳答案

这就是 set offsets 的用途:向 gnuplots 自动缩放范围添加一些偏移量:

没有偏移量(这是你的情况):

$data <<EOD
1 1
2 2
EOD
plot $data with lp pt 7 ps 2 notitle

enter image description here

在 x 方向有偏移:

$data <<EOD
1 1
2 2
EOD
set offsets 0.1, 0.1, 0, 0
plot $data with lp pt 7 ps 2 notitle

enter image description here

如您所见,您在左侧和右侧的图边距处获得了偏移量。但是,边距的大小不是以第一个轴为单位的 0.1,而是四舍五入到下一个自动生成的 tic。

要解决此问题,您可以添加 set autoscale xfix:

$data <<EOD
1 1
2 2
EOD
set offsets 0.1, 0.1, 0, 0
set autoscale xfix
plot $data with lp pt 7 ps 2 notitle

enter image description here

关于第一行点之前和最后一行之后的 gnuplot 水平空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47215334/

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