【问题标题】:Point limitation for PDL Gnuplot and QT terminal using replot使用 replot 对 PDL Gnuplot 和 QT 终端进行点限制
【发布时间】:2022-03-11 05:09:16
【问题描述】:

在使用 PDL::Graphics::Gnuplot 绘制数据时,我遇到了一个奇怪的效果。看来,使用replot 一次只能绘制有限数量的点。

考虑以下示例(15 行,101 个点):

use strict;
use warnings;

use PDL;
use PDL::Graphics::Gnuplot qw/gpwin/;

my $win = gpwin('qt', persist => 1);

foreach my $a (1..15) {
    my $x = sequence(101)/100;

    my $y = $a*$x;

    if ($a == 1) {
        $win->plot({ linecolor => 'black' }, $x, $y);
    }
    else {
        $win->replot({ linecolor => 'black' }, $x, $y);
    }
}

使用此示例,仅绘制 11 条线而不是 15.

减少点数(从 101 到 51),绘制 14 条线。

最后只用了 21 个点,15 条线全部显示出来。

首先,我认为只绘制了有限数量的线,但事实并非如此,因为绘制的线数取决于 piddles 的大小。

这是 perl 模块或 Gnuplot 的限制吗?有没有办法增加最大点数?这似乎是 Gnuplots qt 版本的问题。使用'x11' 作为终端不会显示此限制(我测试了 100 行 101 点没有任何问题)。

此外,我在不使用 replot 的情况下测试了相同的示例,但使用了单个 plot

use strict;
use warnings;

use PDL;
use PDL::Graphics::Gnuplot qw/gpwin/;

my $win = gpwin('qt', persist => 1);

my $x = sequence(101)/100;
my $a = sequence(1,15)+1;
my $y = $x*$a;

$win->plot({ linecolor => 'black' }, $x, $y);

使用此代码,一切正常(即使将行数增加到明显更大的值)。

所以最后,这似乎是'qt' 终端的replot 功能的问题。

(G N U P L O T 版本 4.6 补丁级别 6)

【问题讨论】:

  • 这听起来像一个错误。您应该将其报告给 PDL::Graphics::Gnuplot 维护者here

标签: perl gnuplot pdl


【解决方案1】:

我已经打开了an issue on PDL::Graphics::Gnuplot - 希望 Gnuplot 现在是 5.4,这不会是一个问题!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-19
    • 2017-05-30
    • 1970-01-01
    • 1970-01-01
    • 2016-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多