Hi Paul,
A little late to the party, but I can add a couple of points.
1:
If you have the points all at once, then as David says, this would work fine
(and for your 131,085 points my aging MacBook Pro with IDL 8.2.2 did this Plot()
in 3.77 seconds)
;; Placing all points in one plot (no joining lines)
p = PLOT(lon, lat,$
SYMBOL='circle', $ ; SYM_COLOR=colour,$ ; not needed
/SYM_FILLED, $ ; SYM_FILL_COLOR=colour,$ ; not needed
RGB_TABLE=3, $
VERT_COLORS=colour, $
LINESTYLE=6, $
/OVERPLOT)
But if you really need to add the points one at a time (because they're not
available at the start), p.SetData is your friend, allowing you to assign a new,
longer set of lon/lat values as you get new data. I'm simulating this situation
here, and assuming that the colours aren't known beforehand either:
;; Placing first two points in a plot (no joining lines)...
p = PLOT(lon[0:1], lat[0:1],$
RGB_TABLE=3, $
SYMBOL='circle', $ ;SYM_COLOR=colour[0:1],$
/SYM_FILLED, $ ;SYM_FILL_COLOR=colour[0:1],$
VERT_COLORS=colour[0:1], $
LINESTYLE=6, $
/OVERPLOT)
FOR i = 1L, N_ELEMENTS(variable)-1L DO BEGIN ; Each time we get new data
map.Refresh, /Disable
p.SetData, lon[0:i], lat[0:i]
p.Vert_Colors = colour[0:i]
map.Refresh
END
2:
I found an oddity in the behaviour with and without refreshing: how is it that
when only performing *two* operations, having it refresh automatically takes
*three* times as long as doing one refresh at the end? This is with the 131,085
points (note that I'm using the handy 8.2.2 routines TIC and TOC that just start
and stop a timer... somebody may have liked my old TStart and TReport routines!):
IDL> map.Refresh & tic & p.setdata, lon, lat & p.Vert_Colors = colour & toc
% Time elapsed: 10.551133 seconds.
IDL> map.Refresh, /Disable & tic & p.setdata, lon, lat & p.Vert_Colors = colour
& map.Refresh & toc
% Time elapsed: 3.6593549 seconds.
Chris? Mark? Could there be an extra redraw happening when refresh is on?
Cheers,
-Dick
Dick Jackson Software Consulting
Victoria, BC, Canada --- +1-250-220-6117
dick@d-jackson.com --- http://www.d-jackson.com
David Fanning wrote:
> Paul van Delst writes:
>
>> And here is my practically line-by-line translation of the above using
>> FG. note that I am using "PLOT()" to approximate PLOTS by simply
>> overplotting the same point.
>
> My first thought would have been to try to plot all points at once, with
> a single Plot() command, without the loop. Did you try that?
>
> Cheers,
>
> David
>
>
>
--
Cheers,
-Dick
Dick Jackson Software Consulting
Victoria, BC, Canada
www.d-jackson.com
|