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

Home » Public Forums » archive » 3D Scatterplots
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
3D Scatterplots [message #33131] Mon, 09 December 2002 15:22
Paul Sorenson is currently offline  Paul Sorenson
Messages: 48
Registered: May 2002
Member
> "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 =-----
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: fast array comparison
Next Topic: Re: How to use pointers instead of arrays

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

Current Time: Wed Oct 08 14:53:35 PDT 2025

Total time taken to generate the page: 0.00543 seconds