In article <MPG.1a22ce8b188d84eb989740@news.frii.com>, David Fanning <david@dfanning.com> writes:
[snip original post]
> This shouldn't be too hard, although slow if you
> have a lot of points. Then, of course, there is the VAX... :-)
>
> Here is an example:
>
> PRO Example
> Device, Decomposed=0
> x = [0.0, 1, 2, 3, 4, 6]
> y= [0.0, 1, 2, 3, 4, 6]
> Plot, x, y, /NoData
> FOR j=0,N_Elements(x)-2 DO BEGIN
> FOR k=0,N_Elements(x)-2 DO BEGIN
> TVLCT, Fix(Randomu(seed,1)*255), Fix(Randomu(seed,1)*255), $
> Fix(Randomu(seed,1)*255), 255
> Polyfill, [x[j], x[j], x[j+1], x[j+1], x[j]], $
> [y[k], y[k+1], y[k+1], y[k], y[k]], $
> Color=255
> ENDFOR
> ENDFOR
> END
>
> Cheers,
>
> David
Thanks, David. This is about what I do now. I was sort of hoping for
something along the lines of
create large array A (82x22 or bigger if need be)
fill array A with values based on some special formula
do one TVxxx call with A to display it all at once
The catch, of course, is in step 2. If each element of A is displayed as
one pixel, then one won't be able to see the colored regions. Since the
size of each rectangular region is L/22 wide by L/82 high, where L the the
size of the side of the square plot region, we'd need A to be 1804x1804 (22*82),
and each region with A would be 82 wide by 22 high, and all the same value.
That's sort of what I was thinking. Of course, this could be optimized a bit
by removing the common factor of 2. While this approach minimizes the number
of plotting or drawing calls, it wastes temporary storage space.
I'm starting to think this other approach isn't much better, and is in fact
worse, that the double FOR loop with repeated calls to polyfill. Unless
there's a way to dramatically improve its design. Thoughts?
Lawrence Bleau
University of Maryland
Physics Dept., Space Physics Group
301-405-6223
bleau@umtof.umd.edu
|