orangelubee wrote:
> Hello all,
> I've been trying to make a very simple 3D graph for days now and I'm
> completely stumped because I know nothing about this. My data is
> gridded data of temperatures at different levels of the atmosphere
> over Antarctica and I have nice plots using map_set and contour for
> each level separately but I would really like to have a 3D version of
> just one temperature contour throughout the entire atmosphere. Is
> there a way to get a z-axis added to a map and contour at each level?
> I've tried using T3D but I'm not understanding how it applies to
> contour and plot or really how it works at all. I've also tried to
> use the isosurface, scale3 and then polyshade to view a certain
> temperature surface but I keep running into this error: POLYSHADE:
> Vertex 0: X,Y,Z location out of range. which I dont know how to fix.
>
> Is there an easy way to do this or am I way off track?
I think you're heading in the right direction. I wrote a 3d-plotter many years ago to plot
radiosondes ascents in 3-d (I think I may have nicked a copious amount of the code from
one of David Fanning's programs). I can only offer tips towards a direct graphics solution.
Anyway, looking at the code I have, I see stuff like this:
; -----------------------------------------------------
; Use SURFACE to establish the 3D transform and draw
; the base X, Y, and Z axes.
; The IDL documentation was very unclear on how to draw
; axes (i.e. where to get the co-ordinate points from)
; if T3D and SCALE3 are used. So, this method will be
; oh-so-slow for very large n.
; -----------------------------------------------------
SURFACE, FLTARR( n, n ), x, y, $
AZ = 50, $
/NODATA, $
/SAVE
; --------------------------------------------
; Draw the "*" axes as shown below:
;
; ***********
; ** *
; * * *
; o * *
; o * *
; Z o **********o
; o * o
; o* o X
; ooooooooooo
; Y
;
; The axes designated with a "o" are drawn by
; the initial call to SURFACE. All others, the
; "*" axes, are drawn via the AXIS commands
; that follow.
; --------------------------------------------
; -- Dummy axes name
name = REPLICATE( ' ', 30 )
; -- Draw the various axes with default ticklength and no names
AXIS, xmax, ymin, zmin, $
/YAXIS, /T3D, $
YLOG = ylog, $
YTICKNAME = name, YTICKLEN = 0
AXIS, xmax, ymin, zmin, $
/ZAXIS, /T3D, $
ZLOG = zlog, $
ZTICKNAME = name, ZTICKLEN = 0
AXIS, xmin, ymax, zmin, $
/XAXIS, /T3D, $
XLOG = xlog, $
XTICKNAME = name, XTICKLEN = 0
AXIS, xmin, ymax, zmax, $
/XAXIS, /T3D, $
XLOG = xlog, $
XTICKNAME = name, XTICKLEN = 0
AXIS, xmax, ymax, zmin, $
/ZAXIS, /T3D, $
ZLOG = zlog, $
ZTICKNAME = name, ZTICKLEN = 0
AXIS, xmax, ymin, zmax, $
/YAXIS, /T3D, $
YLOG = ylog, $
YTICKNAME = name, YTICKLEN = 0
; ------------------------------
; Enable use of the 3D transform
; ------------------------------
!P.T3D = 1
; --------------------
; Plot the actual data
; --------------------
PLOTS, x, y, z, /T3D
; --------------------
; Plot the projections
; --------------------
; XY projection
IF ( xyproject EQ 1 ) THEN $
PLOTS, x, y, FLTARR( n ) + zmin, $
/T3D, $
THICK = thick, COLOR = project_color, LINESTYLE = linestyle
.etc....
; ---------------------------
; Turn off 3D transformations
; ---------------------------
!P.T3D = 0
I think the important thing is how you establish the 3D transform. I used an "empty"
surface plot. Getting the contour plot on there as well is not something I know how to do
0off the top of my head, but I think there may be a how-to on that in the IDL docs.
Or on David's website (I would check that first). Struan Grey (Gray?) used to have a
website dedicated to all these sorts of shenanigans. Maybe it's still out there?
Good luck.
cheers,
paulv
|