> "Thomas Wright" <twright@usgs.gov> wrote in message
> news:aee1db91.0207110002.b4d9e7a@posting.google.com...
>> My question: has anyone developed an idl routine that has full
>> capacity to deal with 3-d point data? If not, would any idl developer
>> be willing to modify one of the above routines to satsify this need?
> XPLOT3D might work. It is rotateable like surf_track.
> IDL> xplot3d, x, y, z, symbol=oSymbol, linestyl=6
I wrote an example for Thomas that I thought I might post here as well. It
shows how you can use a variety of 3D shapes for scatterplot symbols. Color
and size of symbols is varied too. Craig Markwardt might also enjoy this
example for it's bovine-ness :-) (Craig works on a project named C.O.W., I
think.)
-Paul Sorenson
pro cowplot
;
;Purpose: provide and example showing how to use xplot3d
;for scatter plots. This program shows that a variety of
;symbols can be used, with symbols varying in shape,
;color and size. In this example, color is a function of
;x, shape is a function of y, and size is a function of z.
;
;Paul Sorenson, Dec. 2002
;
;Create a master bovine polygon.
;
restore, filepath('cow10.sav', subdir=['examples','data'])
oMasterCow = obj_new('IDLgrPolygon', $
x, $
y, $
z, $
polygon=polylist $
)
;
;Create a master cone polygon.
;
mesh_obj, 6, vertex_list, polygon_list, $
[[0.25, 0.0, -0.25], [0.0, 0.0, 0.25]], $
p1=16
oMasterCone = obj_new('IDLgrPolygon', $
vertex_list, $
polygon=polygon_list, $
color=[255,0,0] $
)
;
;Generate scatter data, and plot it.
;
n = 100 ; Number of symbols.
ramp = findgen(n) / (n-1)
x = sin(ramp * 20)
y = cos(ramp * 20)
z = ramp
oPolygons = objarr(n)
oSymbols = objarr(n)
oModels = objarr(n)
oPalette = obj_new('IDLgrPalette')
oPalette->LoadCT, 1
oPalette->GetProperty, $
red_values=red_values, $
green_values=green_values, $
blue_values=blue_values
for i=0,n-1 do begin
color_index = $ ; a function of x.
(bytscl([min(x), x[i], max(x)], top=127))[1] + 128b
oPolygons[i] = obj_new('IDLgrPolygon', $
share_data= $ ; a function of y.
y[i] gt mean(y) ? oMasterCone : oMasterCow, $
polygon= $ ; a function of y.
y[i] gt mean(y) ? polygon_list : polylist, $
color=[ $
red_values[color_index], $
green_values[color_index], $
blue_values[color_index] $
], $
shading=1 $
)
scale = .75 * z[i]^2 + .1 ; a function of z.
oModels[i] = obj_new('IDLgrModel')
oModels[i]->Add, oPolygons[i]
oModels[i]->Rotate, [1, 0, 0], 90 ; Stands cow upright.
oModels[i]->Scale, scale, scale, scale*.5
oSymbols[i] = obj_new('IDLgrSymbol', oModels[i])
end
xplot3d, x, y, z, $
symbol=oSymbols, $
linestyle=6, $
/block
obj_destroy, oSymbols
obj_destroy, oModels
obj_destroy, oMasterCow
obj_destroy, oMasterCone
obj_destroy, oPalette
end
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
|