gnuplot在第一个线点之前和最后一个点之后的水平空间 [英] gnuplot horizontal space before first line point and after last

查看:79
本文介绍了gnuplot在第一个线点之前和最后一个点之后的水平空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用:gnuplot 4.2补丁程序级别6

using: gnuplot 4.2 patchlevel 6

我正在绘制烛台.当然,第一个和最后一个数据点在左侧和右侧的Y轴条上.第一个和最后一个烛台几乎都被轴栏隐藏.啦啦

I am plotting candlesticks. The first and last data points are, of course, on the left and right Y axis bars. The first and last candlesticks are all but hidden by the axis bars. a la:

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

有没有办法伪造"一个空的起点和终点?我试过添加零值,但这只是在开始和结束处画出了一条线.

Is there a way to "fake" a null starting and ending point? I have tried adding zero values but that just grounds the plotted line(s) at the start and end.

推荐答案

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

That's what set offsets is for: Add some offsets to gnuplots autoscaled range:

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

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

在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

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

As you can see, you get offsets at the left and right plot margins. However, the margin's size isn't 0.1 in units of the first axis, but the value is rounded to the next auto-generated tic.

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

To work around this, you can add 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

这篇关于gnuplot在第一个线点之前和最后一个点之后的水平空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆