填充曲线中的Gnuplot间隙值大于yrange

时间:2015-01-07 12:30:46

标签: plot gnuplot

我遇到了Gnuplot填充曲线显示出差距的问题。我使用Fedora提供的4.6版补丁级别5。

这就是我在做的事情:

    - 生成一个平滑值的表格,如下所示:
set table 'smoothedhdata'
plot 'data_file' using 1:2 smooth cspline
unset table
    - 取消设置表,设置输出,设置多个时间,设置yrange
    - 剧情:
plot 'smootheddata' using 1:2 with filledcurves x1 lc rgb "forest-green" title "Some Title";

出现的问题是,数据中存在一些值,这些值高于yrange限制的区域。对于这些值,使用pngcairo以及使用svg在输出中存在间隙。对于更熟悉gnuplot的人来说,这可能是微不足道的,但到目前为止我还没有找到解决方案。有没有人看过这种行为并且知道一种解决方法,或者这可能是Gnuplot中某处的错误?

    - 这是一张图,显示绿色图中的一些差距:

Here's a plot showing a few of those gaps in the green graph

1 个答案:

答案 0 :(得分:1)

Gnuplot版本4.6在填充区域的正确剪切方面存在一些问题。这可能是造成问题的原因。版本5.0已经重新设计剪辑,因此可能是新版本工作正常(由于我没有测试数据,因此无法测试)。

或者,您可以尝试手动剪切using语句中的值。这应该有效,因为您无论如何都要绘制数据两次并且您具有预先计算的yrange限制(或者使用yminymax的自定义yrange值):

set table 'smoothedhdata'
plot 'data_file' using 1:2 smooth cspline
unset table

ymax = GPVAL_Y_MAX
ymin = GPVAL_Y_MIN
clip(y) = (y < ymin ? ymin : (y > ymax ? ymax : y))

plot 'smootheddata' using 1:(clip($2)) with filledcurves x1 lc rgb "forest-green" title "Some Title"
相关问题