Lund Fysicum Maxlab Sljus STM Group
[ Lund University ] [ Fysicum ] [ Maxlab ] [ Sljus ] [ STM Group ]


Extending IDL's Surface Plotting Routines

Struan Gray
Dept. of Synchrotron Radiation Research,
Lund University, Sweden


Final Image

There are two main ways to plot a 3D representation of 2D data in IDL: the SURFACE and SHADE_SURF procedures. Both of these routines are very flexible and can be extended via the SHADES keyword to produce plots where the position of a data point is determined by one array and it's colour by a second. Both routines can also be made to work in the z-buffer so that two or more intersecting surfaces can be displayed on the same plot.

However, although these built-in IDL routines provide a powerful way of displaying surfaces, they have their drawbacks. In particular they do not take full advantage of the graphics capabilities of 24-bit displays, and the plots they produce do not always give a clear picture of the shape of the surface in 3D space. This tutorial shows how to use the IDL procedures as a starting point for the construction of more complex plots such as the one shown above.


Contents

The tutorial is best read in the order given above, and there are code snippets embedded in the pages which will work correctly if they are pasted into the command line of IDL in sequence - so you can produce simple versions of the plots as you read the tutorial. On the example code page there are two utility routines used to plot and read 24-bit images on any bit-depth screen, and commented sample code which can be used to create a huge variety of different sorts of plot, using the ideas presented here. Please let me know if you find any bugs.


Copyright Struan Gray 1997


Lund Home Fysicum Maxlab Sljus STM Group
[ Lund University ] [ Fysicum ] [ Maxlab ] [ Sljus ] [ STM Group ]

Maintained by: Sljus Webmaster
970313