Point restriction for Gnuplot PDL and QT terminal using replot

When using PDL :: Graphics :: Gnuplot to build data, I came across a strange effect. It seems that only a limited number of points are built at a time using replot .

Consider the following example (15 lines with 101 points):

 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); } } 

Using this example, instead of 15. only 11 lines are constructed. using 101 points

Reducing the number of points (from 101 to 51), built 14 lines. using 51 points

And finally, using only 21 points, all 15 lines are displayed.

using 21 points

Firstly, I thought that only a limited number of lines were drawn, but this is not true, since the number of lines built depends on the size of the teenager.

Is this the limit of perl or gnuplot module? Is there a way to increase the number of maximum points? This seems to be the issue of the Gnuplots qt version. Using 'x11' as a terminal does not display this limitation (I tested 100 lines with 101 points without any problems).

Next, I test the same example without using replot , but in one 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); 

Using this code, everything works fine (even when increasing the number of lines to significantly larger values).

101 points in one plot

So this is apparently the issue of the replot functionality of the 'qt' terminal.

(GNUPLOT Version 4.6 patchlevel 6)

+6
source share

All Articles