3-D & 2-D plots simultaniously [message #1289] |
Thu, 12 August 1993 10:56 |
jabarone
Messages: 15 Registered: May 1993
|
Junior Member |
|
|
Hi,
I've been trying to plot a 3-D image and two 2-D images in
the same plot window. These images are the surface plotted from
arrays z, x, y and the 2-D plots of x vs z and y vs z. I do this
by first plotting the surface plot using the save keyword and then
excanging the axis and using plot with the T3D and NOERASE keywords
set for the other two plots.
Here is an example:
a = shift(dist(15), 5, 5)
a = exp(-(a/4)^2)
pos = [.1, .1, .95, .95, 0, 1]
pos(0) = pos(0) + .2
pos(2) = pos(2) - .2
pos(1) = pos(1) + .2
pos(3) = pos(3) - .2
x1 = pos
x1(1) = x1(4)
x1(3) = x1(5)
x1(4) = pos(1) - .1
x1(5) = pos(1) - .1
y1 = pos
y1(0) = y1(1)
y1(2) = y1(3)
y1(1) = y1(4)
y1(3) = y1(5)
y1(4) = pos(0) - .1
y1(5) = pos(0) - .1
surface, a, /save, charsize = 2, position = pos, title = "Surface"
temp = pos
temp(4) = temp(5)
;contour, a, /t3d, position = pos, /noerase, charsize = 2
z = fltarr(225)
for i = 0, 14 do $
z(i*15:i*15+14) = a(i, *)
x = fltarr(225)
for i = 0, 14 do $
x(i*15:i*15+14) = indgen(15)
y = x
tmp = !P.t
t3d, /yzexch
plot, x, z, /t3d, charsize = 2, psym = 2, position = x1, /noerase, $
title = "X vs Z Plot"
t3d, /xzexch
plot, y, z, /t3d, charsize = 2, psym = 4, position = y1, /noerase, $
title = "Y vs Z Plot"
!p.t = tmp
The problem I'm having is that if I use the position keyword to scale
and reposition the plots the data for the 2-D plots seems to be
"disembodied" from their respective axis. The above example demonstrates
this. What I mean by "disembodied" is that the data that is associated
with an axis seems to be plotted behind the axis and not "on" the axis.
Does anyone have any idea how to top this from happening?
You may wonder why I'm trying to shrink and then move these images.
Well I would like to be able to plot more than one of these images on one
page in which case I need to be able to control where they are positioned.
However, if I do this using the POSITION key word the data gets disembodied
from its axis as discribed above.
Any suggestions would be greatly appreciated.
Thanks in advance.
John Barone
jabarone@athena.mit.edu
|
|
|