Re: contour lines on shades surface ? [message #31591] |
Thu, 01 August 2002 09:19 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jochen Weller (jw249@damtp.cam.ac.uk) writes:
> can somebody tell me how to place contour lines
> on the surface of a shaded surface plot ?
Well now, it is the "on the surface" part that is
going to cause you the heartache. Because when
lines are "on the surface" sometimes they are a
bit in front of the surface and sometimes they
are a bit behind the surface (all due to round-off
errors and the way computers store numbers, for those
of you who love a long digression), so that the actual
line appears a bit blotchy, at least in practice.
The best results are when the contour lines are a
tiny bit "above the surface", but getting this to
happen is easier said then done.
In any case, you can see the basic technique (as
well as the problems) by using this code:
thisDevice = !D.Name
data = Dist(40)
LoadCT, 0
Set_Plot, 'Z'
Shade_Surf, data, /Save
Contour, data, NLevels=1, /Overplot, /T3D
snapshot = TVRD()
Set_Plot, thisDevice
TV, snapshot
You might be better off working out some other visualization
method. Here is an example program that allows you to move a
filled contour plot through a shaded surface.
http://www.dfanning.com/misc/surf_contour.pro
Run it like this:
IDL> Surf_Contour
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|