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

Home » Public Forums » archive » 3D plotting
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 plotting [message #748] Mon, 19 October 1992 14:31 Go to next message
dere is currently offline  dere
Messages: 4
Registered: October 1992
Junior Member
I have been trying to do some 3D plotting using the Surface routine and then using Contour and Plots. However, the two do not seem to share the same coordinate system. Any ideas?
Re: 3D plotting [message #51177 is a reply to message #748] Wed, 08 November 2006 07:05 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Eric writes:

> I'm trying to find the most efficient way to make a 3D plot. I'm
> going into my plot code with 5 variables, r_x, r_y, r_z, count and
> color_scale.
>
> r_x, r_y and r_z are arrays with the data points, count is the number
> of points to plot and color_scale is an array of colors for each point.
> The way I'm doing it right now (using XPLOT3D) is taking A LONG time
> to plot (around 230 data points) and is also very difficult to rotate
> the plot the way I want after it is already created. I tried using
> iPlot, but it doesn't seem to like me using an array with a color
> from a color table (it seems to prefer RGB?). Is there a way of doing
> this in iPlot? Any other suggestions are welcome as well.

I managed to get color working by doing something like this:

zcolors = BytScl(z)
thisPalette = Obj_New('IDLgrPalette')
thisPalette->LoadCT, 5
thisPalette->GetProperty, Red=r, Green=g, Blue=b
Obj_Destroy, thisPalette

; Create the symbols for each point.
npts = N_Elements(x)
theseSymbols=ObjArr(npts)
FOR j=0,npts-1 DO BEGIN

oOrb = obj_new('RHTgrPSolid', /TETRAHEDRON, $
Color=[r[zcolors[j]], g[zcolors[j]], b[zcolors[j]]])
theseSymbols[j] = OBJ_NEW('IDLgrSymbol', oOrb, $
Size=[0.05, 0.05, 0.05])
ENDFOR

; Create Polyline object..
thisPolyline = OBJ_NEW('IDLgrPolyline', x, y, z, $
LineStyle=6, Symbol=theseSymbols)



You can find the complete program here

http://www.dfanning.com/misc/scatter_surface.pro

I tried it with 300 points and it seems to rotate OK.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: 3D plotting [message #51290 is a reply to message #51177] Wed, 08 November 2006 23:46 Go to previous message
eric :) is currently offline  eric :)
Messages: 3
Registered: November 2006
Junior Member
wow, i had no idea you could make an array of objects. that fixed
everything

thanks a lot!

Eric



David Fanning wrote:
> Eric writes:
>
>> I'm trying to find the most efficient way to make a 3D plot. I'm
>> going into my plot code with 5 variables, r_x, r_y, r_z, count and
>> color_scale.
>>
>> r_x, r_y and r_z are arrays with the data points, count is the number
>> of points to plot and color_scale is an array of colors for each point.
>> The way I'm doing it right now (using XPLOT3D) is taking A LONG time
>> to plot (around 230 data points) and is also very difficult to rotate
>> the plot the way I want after it is already created. I tried using
>> iPlot, but it doesn't seem to like me using an array with a color
>> from a color table (it seems to prefer RGB?). Is there a way of doing
>> this in iPlot? Any other suggestions are welcome as well.
>
> I managed to get color working by doing something like this:
>
> zcolors = BytScl(z)
> thisPalette = Obj_New('IDLgrPalette')
> thisPalette->LoadCT, 5
> thisPalette->GetProperty, Red=r, Green=g, Blue=b
> Obj_Destroy, thisPalette
>
> ; Create the symbols for each point.
> npts = N_Elements(x)
> theseSymbols=ObjArr(npts)
> FOR j=0,npts-1 DO BEGIN
>
> oOrb = obj_new('RHTgrPSolid', /TETRAHEDRON, $
> Color=[r[zcolors[j]], g[zcolors[j]], b[zcolors[j]]])
> theseSymbols[j] = OBJ_NEW('IDLgrSymbol', oOrb, $
> Size=[0.05, 0.05, 0.05])
> ENDFOR
>
> ; Create Polyline object..
> thisPolyline = OBJ_NEW('IDLgrPolyline', x, y, z, $
> LineStyle=6, Symbol=theseSymbols)
>
>
>
> You can find the complete program here
>
> http://www.dfanning.com/misc/scatter_surface.pro
>
> I tried it with 300 points and it seems to rotate OK.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Analyst and PV-WAVE
Next Topic: First Posting

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

Current Time: Wed Oct 08 15:14:25 PDT 2025

Total time taken to generate the page: 0.00718 seconds