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

Home » Public Forums » archive » using cgSurface to produce a scatter 3D plot with 4th dimension
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
using cgSurface to produce a scatter 3D plot with 4th dimension [message #79527] Wed, 07 March 2012 03:16 Go to previous message
Sebastian Schäfer is currently offline  Sebastian Schäfer
Messages: 7
Registered: March 2012
Junior Member
Hi,

I have a datacube like this and two arrays with the values for the 3
axes
L1 DOUBLE = Array[100]
L2 DOUBLE = Array[100]
SINF DOUBLE = Array[100]
XI2MAP DOUBLE = Array[100, 100, 100]

I select a number of points using where() and now want to create a 3D
plot of these points and use the color to represent their value. I
managed to do this with cgsurf:



max_xi = 800
select = where(xi2map LT max_xi,count)
WhereToMulti, xi2map, select, Col, Row, Frame
xi2 = xi2map[col,row,frame]
symColors = Fix(BytScl(xi2))

cgLoadCT, 3
cgSurf,
dist(100),l1,l2,xrange=[min(l1),max(l1)],yrange=[min(l2),max (l2)],zrange=[min(sinf),max(sinf)],xstyle=1,ystyle=1,$
/NoErase, xtitle='lambda_1',ytitle='lambda_2',ztitle='stability',/
nodata,/window,/save

cgAxis,XAxis=1,/T3D,XStyle=1,/window
cgAxis,YAxis=1,/T3D,YStyle=1,/window
cgAxis,ZAxis=0,/T3D,max(l1),min(l2),/window
cgAxis,ZAxis=0,/T3D,max(l1),max(l2),/window

cgColorbar, Divisions=4, Minor=5, Format='(F0.2)',
Range=[min(xi2map[select]), max(xi2map[select])],title='Xi2',/add

cgControl, Execute=0
FOR i=0,count-1 DO BEGIN
cgplots,[l1[col[i]],l1[col[i]]],[l2[row[i]],l2[row[i]]],
[sinf[frame[i]],min(sinf)],color=cgcolor('light gray')$
, /T3d,/add
ENDFOR

FOR i=0, count-1 DO BEGIN
cgplots,l1[col[i]],l2[row[i]],min(sinf),/
t3d,psym=3,symsize=1.0,color=cgColor('black'),/add
ENDFOR

FOR i=0, count-1 DO BEGIN
cgplots,l1[col[i]],l2[row[i]],sinf[frame[i]],/
t3d,psym=symcat(16),symsize=2,color=cgColor(StrTrim(symcolor s[i],2)),/
add
ENDFOR
cgControl, Execute=1


that's pretty much how David Fanning explained it in his traditional
grafics book (pages 185-197). Now I am trying to get this working with
cgsurface so I can rotate and zoom mi xi2 map. Is this even possible
with cgsurface since it only accepts the data in 2D?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Black screen movie
Next Topic: Re: Question about storing arrays in pointer array.

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

Current Time: Wed Oct 08 16:12:52 PDT 2025

Total time taken to generate the page: 0.00196 seconds