Hi Craig

One more bug with P:G:Gnuplot.

When I plot multiple data sets in 1 plot like this:

use PDL::Graphics::Gnuplot;
my $w = gpwin('x11');
my $a = ones(100);
my $b = ones(100) * 1.5;
my $c = ones(100) * 0.5

$w->plot(
            { with => 'lines'}, $a,
            { with => 'points', pointtype => 7}, $b,
            { with => 'lines'}, $c
);

I get this error from gnuplot saying "No pointtype specifier allowed
here" where the plot command generated is:

plot '-' using 0:1 notitle with lines, '-' using 0:1 notitle with points
pointtype 7, '-' using 0:1 notitle with lines pointtype 7
^^^^^^^

As you can see the 'pointtype' is being set even for 'lines' despite me
not having set it in the plot() command.

This is a bug ! Point-type is valid for 'linespoints' and 'points' only,
not for 'lines'. In fact, I think if I set it for one data series in the
plot() call it shouldn't carry over to the others following it.

When instead to avoid this problem I do { with => 'points pointtype 7' }
I get deprecated warnings related to complex 'with' statements.

Thanks
Vikas




On 08/19/2014 05:25 PM, Craig DeForest wrote:
> Very interesting.  This looks to be a genuine non-exercised bug.  I'll have a 
> look at the emission code and get it fixed ASAP (and of course add a test 
> case).  I'm on travel at the moment so it may be a day or two.
>
> All the best,
> Craig
>
>
> On Aug 19, 2014, at 9:22 PM, Vikas N Kumar <vi...@cpan.org> wrote:
>
>> Hi Craig/Dima
>>
>> When using P::G::Gnuplot, I am getting an error with the size parameter.
>> Unfortunately the demo.pl in your source does not use this feature and I
>> am not sure if my gnuplot is the problem. I am using 4.4. I am also
>> using the latest P::G::Gnuplot from CPAN.
>>
>> The gnuplot ends up seeing "set size 1 0.7" instead of "set size 1,
>> 0.7". I have a fix by setting size => ["1, 0.7"] which is a string but
>> that is a hack. the "set origin" call seems to work fine and I couldn't
>> figure out by looking at the source why the "set size" was not working
>> right. I tried using the string "ratio" because it seemed like that was
>> another option but that failed to work as well.
>>
>> The code that I would like to use is below.
>>
>> my $w = gpwin('x11');
>> $w->multiplot(title => 'A multiplot');
>> $w->plot(
>>            {
>>                size => [1, 0.7],   #### ["1, 0.7"] works
>>                origin => [0, 0.3],
>>            }
>>             {with => 'financebars'},
>>            sequence(100), # time - x-axis
>>            sequence(100)  * 1.001,  # open
>>            sequence(100) * 1.0015,  # high
>>            sequence(100) * 1.0005,  # low
>>            sequence(100) * 1.00125  #close
>>        );
>> $w->plot(
>>            {
>>                size => [1, 0.3], ####["1, 0.3"] works
>>                origin => [0, 0],
>>               }
>>             {with => 'impulses'},
>>            sequence(100) * 1.01 # volume in 100000 units
>>        );
>> $w->end_multi;
>>
>>
>>
>>
>> _______________________________________________
>> Perldl mailing list
>> Perldl@jach.hawaii.edu
>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>>
>
>


_______________________________________________
Perldl mailing list
Perldl@jach.hawaii.edu
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to