Thanks for the suggestions.... that Inline PP stuff looks pretty
slick.  The "Abandon all hope" in the documentation usually keeps me
out of the PP realm, though I have used it once or twice to make a
simple robust stats routine (throw out outliers, recompute stats). :)

Cheers,
David


On Thu, May 21, 2009 at 4:45 PM, Craig
DeForest<[email protected]> wrote:
> I'm with Karl, though you could also try manually plotting to a large bitmap
> array if you want to get a greyscale view.
>
> Note that range(), while tempting, won't help you with that problem.  This
> is a good chance to get familiar with inline PP, which is pretty nice once
> you get the hang of it.  PP is a metalanguage built on C, that gets parsed
> and compiled to make PDL primitives.  Inline does just-in-time compilation
> and linking of other types of code.  The following code will make a nice
> 1000x1000 demo histogram for you.  The cost of plotting is very small
> compared to the cost of all those sine evaluations! (I've attached a plot of
> the output)
>
> The pp_def just declares a loop over the N dimension of the coordinates,
> that increments the appropriate element of bigolbitmap.
>
> This could probably be done much more elegantly and general-purposely, but
> of late I've gotten in the sad habit of ripping this sort of thing out
> when/as needed.  (Note that the "use Inline" won't work well if you paste
> directly into the command line; you have to paste into a text file and then
> 'do' that file).
>
>
>
>
> $tpoints = xvals(5e6)*3.14159/180;
> $xpoints = 500+500*sin($tpoints*7);
> $ypoints = 500+500*sin($tpoints*5.12);
> $points = cat($xpoints,$ypoints)->mv(-1,0); # 2 x 5e6 set of coords
>
> $out = zeroes(long, 1000,1000);
> $out->inplace->plotpoints($points);
>
>
> no PDL::NiceSlice;
> use Inline PDLPP => <<'FOO'
> pp_def('plotpoints',
>       Pars=>'[o]bigolbitmap(w,h); coords(d,n)',
>       Inplace=>1,
>       Code=><<'EOC'
>        long x,y,xmax,ymax;
>
>        xmax = $SIZE(w)-1;
>        ymax = $SIZE(h)-1;
>
>        loop(n) %{
>          x = $coords( d=>0 ); x=(x<0)?0:(x>xmax)?xmax:x
>          y = $coords( d=>1 ); y=(y<0)?0:(y>ymax)?ymax:y
>
>          $bigolbitmap( w=>x, h=>y )++;
>        %}
> EOC
>      );
> FOO
> ;
>
>
>
>
>
>
> On May 21, 2009, at 4:48 PM, Karl Glazebrook wrote:
>
>> Try pgpnts() and not one at a time (sym = 1 or -1 helps). 250K should
>> not be too bad.
>>
>> A better method would be to plot density contours and them add points
>> only in the outliers, this would require a clever subroutine to be
>> written though.
>>
>> Karl
>>
>>
>>
>> On 22/05/2009, at 7:44 AM, David Donovan wrote:
>>
>>> Hi All,
>>>
>>> I'm trying to plot something on the order of 250,000 points to a file,
>>> but it's bring my machine (~2GB RAM) to its knees.  I'm using
>>> PDL::Graphics::PGPLOT in a loop 20,000 times to plot
>>> approximately 100 values each time...  the resulting .ps file is
>>> essentially not convertible to a pdf.   Any suggestions on how to deal
>>> with something like this? I want to see the outliers, but obviously I
>>> can't distinguish between 1000 or 10000 points if they're below the
>>> printer's resolution.  Is Plplot a little better about not adding any
>>> more points than necessary?
>>>
>>> Any suggestions you might have would be greatly appreciated.
>>>
>>> Best Regards,
>>> David Donovan
>>>
>>> _______________________________________________
>>> Perldl mailing list
>>> [email protected]
>>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>>
>>
>> _______________________________________________
>> Perldl mailing list
>> [email protected]
>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>>
>
>
>

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to