comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Frustrated by 2 Data Plotting problems
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Frustrated by 2 Data Plotting problems [message #76294 is a reply to message #76293] Thu, 26 May 2011 16:02 Go to previous messageGo to previous message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
Given what I just saw on my screen (speedup by x10) without understanding it, I don't think I should NOT pollute the cgWorld! :-(

All I did (on a hunch...) is replace the line with

cgplot, /over ... (fast!)

for

cgplotS, ... (slowwww!)

I am guessing the advantage is that, "cgplotS" (whether I pass COLOR or SYMCOLOR) has to loop over every dot, but "cgplot, /over" does not?, not in the same way...?
I suppose I could further speed things up by replacing the looped WHERE with a histogram... still, I can now pretty plot 100k dots in 4s (with Z buffer, 6s with X) rather than 80-90s!

Here is the code as it stands now:

h2=sshist_2d(x,y, re=ri1, cost=co, outbin = bin)
xmin = min(X) & ymin = min(y)
h2size = size(h2, /dimen)
col = h2[ floor((x-xmin)/bin[0]) + floor((y-ymin)/bin[1])*h2size[0] ]
cgloadct, ctable

cgplot, x, y, /noda, back=cgcolor('black'), $
color=cgcolor('white'), chars=1.5, _extra = eee

col = bytscl(col)
cmin = min(fix(col), max = cmax)
for c=cmax, cmin, -1 do begin
w=where(col EQ c)
if w[0] ne -1 THEN $
cgplot, x[w], y[w], ps=16, syms=.1, col=c, /ov
endfor
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: question
Next Topic: re-binning with linear interpolation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:17:22 PDT 2025

Total time taken to generate the page: 0.00470 seconds