Vikas, It seems that your problem may have to do with the default communication style under MFW (Microsoft Windows). MFW I/O has had difficulty with the binary interface used under POSIX, so the communication style defaults to ASCII. But if I recall right, Gnuplot can't interpret NaN properly using ASCII communication -- so the missing/BAD points (which are translated to NaN by P::G::G) get rendered as zero.
Can you try this on Microsoft Windows? use PDL::Graphics::Gnuplot; $a = sequence(100)*0.05; $a = $a->setbadif($a<1); $a->((0)) .= 1; $w=gpwin(); $w->line($a); (That should reproduce your bug). Then try: $w->line($a,{binary=>1}); (that should maybe fix it?) If that fixes your problem, then your workaround is straightforward -- just set binary=>1 in your plot object. In the longer term fixing it requires submitting a patch to gnuplot to recognize nan in ASCII input (likely to work) or getting Microsoft Windows binary file I/O to work more reliably (good luck). Please let me know what you find. Cheers, Craig On Aug 31, 2014, at 9:08 PM, Vikas N Kumar <vi...@cpan.org> wrote: > Hi Craig > > Is there any way I can help to fix the Windows plots ? I tried running > PGG in debug mode but that only prints the plot commands and have not > found a way to log the data being sent to Gnuplot in both Windows and > Linux to do a comparison. > > Thanks > Vikas > > On 08/27/2014 03:06 PM, Craig DeForest wrote: >> Thanks, Vikas! I'd love to see some screen shots: I do not run Microsoft >> Windows. >> >> >> On Aug 27, 2014, at 12:26 PM, Vikas N Kumar <vi...@cpan.org> wrote: >> >>> Hi Craig, Dima >>> >>> I am seeing another discrepancy with the latest 2.000 >>> PDL::Graphics::Gnuplot. There is a different output I get with Windows >>> vs Linux gnuplotting related to BAD values. >>> >>> Here is the reproducible code that you can run from PDL shell on both >>> Windows and Linux. >>> >>> pdl> use PDL::Graphics::Gnuplot >>> pdl> $a = sequence(100) * 0.05 >>> pdl> $a = $a->setbadif($a < 1) >>> >>> ## for windows use the 'windows' terminal and for linux use x11 >>> pdl> $w = gpwin( $^O =~/Win32/i ? 'windows' : 'x11') >>> pdl > $w->plot(with => 'lines', $a) >>> >>> >>> As you can see on Linux the BAD values are plotted as expected i.e. they >>> are not plotted. Using both gnuplot 4.4.0 and 4.6.0. >>> >>> On Windows I see the BAD values plotted as either 0 or randomly -1 in my >>> case. I am using gnuplot 4.6.5 on Windows (the latest as per their >>> installer). >>> >>> There is definitely an inconsistency in the plots. Please let me know if >>> I need to send you screenshots or something. >>> >>> Thanks >>> Vikas >>> >>> >>> On 08/26/2014 03:30 PM, Dima Kogan wrote: >>>> Craig DeForest <defor...@boulder.swri.edu> writes: >>>> >>>>> Hi, Vikas, >>>>> >>>>> The behavior is a legacy -- I think it comes from Dima's initial >>>>> implementation. The idea is that curve parameters autodefault to the >>>>> previous value in a list of plots, to save keystrokes or something. I >>>>> find it annoying too -- e.g. I'm forever having to type "lc=>undef" >>>>> after explicitly setting it to (say) green in one particular plot. >>>>> >>>>> Dima -- how attached are you to the autodefaulting behavior? I'd be >>>>> happy to just dike it out and make each curve its own thing (maybe >>>>> switchable back on with a plot option if you want the old style). >>>> As long as you document it I'm fine with it. >>>> >>>> _______________________________________________ >>>> 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 >>> >> >> > _______________________________________________ Perldl mailing list Perldl@jach.hawaii.edu http://mailman.jach.hawaii.edu/mailman/listinfo/perldl