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

Home » Public Forums » archive » Re: Contour plots on xz and yz surfaces
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Contour plots on xz and yz surfaces [message #20326] Wed, 14 June 2000 00:00
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <8i7ih4$d6s$1@peque.uv.es>, Luis Alonso <luis.alonso@uv.es> wrote:

> I'm interested in how you do it, thanks!

Here's the basic code. Run it with no arguments to see a sample.

Ken



PRO TEST_3CONTOUR, x, y, z, xy, xz, yz, xc, yc, zc

; x, y, z : coordinates of points to plot in 3-D scatterplot
; xy, xz, yz : functions to be contoured in each of the planes
; xc, yx, zc : coordinates of grids for xy, xz, yz

IF (N_PARAMS() EQ 0L) THEN BEGIN
np = 1000L
x = RANDOMU(dseed, np)
y = RANDOMU(dseed, np)
z = RANDOMU(dseed, np)
nx = 20L
ny = 25L
nz = 30L
xc = FINDGEN(nx)/(nx-1L)
yc = FINDGEN(ny)/(ny-1L)
zc = FINDGEN(nz)/(nz-1L)
xy = DIST(nx, ny)
xz = DIST(nx, nz)
yz = DIST(ny, nz)
ENDIF

CONTOUR, xy, xc, yc, PATH_XY = xy_path, /PATH_DATA_COORDS, PATH_INFO = xy_info ;Compute x-y contours
CONTOUR, xz, xc, zc, PATH_XY = xz_path, /PATH_DATA_COORDS, PATH_INFO = xz_info ;Compute x-z contours
CONTOUR, yz, yc, zc, PATH_XY = yz_path, /PATH_DATA_COORDS, PATH_INFO = yz_info ;Compute y-z contours

xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
zmin = 0.0
zmax = 1.0
PLOT_3DBOX, x, y, z, PSYM = 3, TITLE = 'Test Plot', $ ;Plot 3D scatterplot
XTITLE = 'X', XRANGE = [xmin, xmax], $
YTITLE = 'Y', YRANGE = [ymin, ymax], $
ZTITLE = 'Z', ZRANGE = [zmin, zmax]

FOR i = 0L, N_ELEMENTS(xy_info) - 1L DO BEGIN
ii = xy_info(i).offset + [LINDGEN(xy_info(i).n), 0L]
PLOTS, xy_path(0L,ii), $ ;Draw an x-y contour
xy_path(1L,ii), $
REPLICATE(zmin, xy_info(i).n+1L), $
/T3D
ENDFOR

FOR i = 0L, N_ELEMENTS(xz_info) - 1L DO BEGIN
ii = xz_info(i).offset + [LINDGEN(xz_info(i).n), 0L]
PLOTS, xz_path(0L,ii), $ ;Draw an x-z contour
REPLICATE(ymax, xz_info(i).n+1L), $
xz_path(1L,ii), $
/T3D
ENDFOR

FOR i = 0L, N_ELEMENTS(yz_info) - 1L DO BEGIN
ii = yz_info(i).offset + [LINDGEN(yz_info(i).n), 0L]
PLOTS, REPLICATE(xmax, yz_info(i).n+1L), $ ;Draw an y-z contour
yz_path(0L,ii), $
yz_path(1L,ii), $
/T3D
ENDFOR

RETURN
END
Re: Contour plots on xz and yz surfaces [message #20332 is a reply to message #20326] Wed, 14 June 2000 00:00 Go to previous message
Luis Alonso is currently offline  Luis Alonso
Messages: 27
Registered: February 2000
Junior Member
I'm interested in how you do it, thanks!

"Kenneth P. Bowman" <kbowman@null.net> wrote
> I solved my own problem. One way to do this is to contour each of the
> planes separately, saving the contour coordinates. Draw the 3D plot
> and then plot each set of contours, specifying the x-, y-, and z-
> coordinates. If anyone is interested, I'll post some code.
>
> Ken
Re: Contour plots on xz and yz surfaces [message #20334 is a reply to message #20326] Tue, 13 June 2000 00:00 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <130620001151050524%k-bowman@null.tamu.edu>, K. Bowman
<k-bowman@null.tamu.edu> wrote:

> I'm looking for something like the library routine PLOT_3DBOX to draw
> multiple contour plots on the inside surfaces of a box. In fact, I
> would like to overplot the contour plots on a PLOT_3DBOX plot.
>
> CONTOUR has a ZVALUE keyword that allows one to position an "xy"
> contour plot in the z-dimension, but AFAIK, there is no similar
> "XVALUE" or "YVALUE" keyword.
>
> Can anyone provide an example of how to draw a contour plot on an "xz"
> surface in a 3-D plot?

I solved my own problem. One way to do this is to contour each of the
planes separately, saving the contour coordinates. Draw the 3D plot
and then plot each set of contours, specifying the x-, y-, and z-
coordinates. If anyone is interested, I'll post some code.

Ken
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: create *.img-file in ENVI/IDL
Next Topic: Re: pickfiles.pro for Windows?

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

Current Time: Wed Oct 08 13:38:29 PDT 2025

Total time taken to generate the page: 0.00609 seconds