【问题标题】:Gnuplot gaps in filledcurve for values larger than yrange对于大于 yrange 的值,填充曲线中的 Gnuplot 间隙
【发布时间】:2015-01-07 12:30:45
【问题描述】:

我在 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 中的某个错误?

    - 这是一个在绿色图表中显示其中一些差距的图:

【问题讨论】:

    标签: plot gnuplot


    【解决方案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"
    

    【讨论】:

    • 您先生,拯救了我的一天!手动裁剪数据可以解决问题。我期待看到这个问题在 Gnuplot 5 中得到修复。
    猜你喜欢
    • 1970-01-01
    • 2020-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    相关资源
    最近更新 更多