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

Home » Public Forums » archive » Defining the size of a symbol relative to the range of a plot for plot3d
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
Defining the size of a symbol relative to the range of a plot for plot3d [message #75893] Mon, 18 April 2011 09:58
andeh is currently offline  andeh
Messages: 23
Registered: April 2011
Junior Member
Hello,

I'm trying to reproduce what was very simple in xplot3d in plot3d and
having all kinds of trouble.
Basically, I am plotting clusters of particles, using a symbol set to
a sphere as each spherule. In xplot3d I could simply write:

; Define particle positions and radius
x = [-3,-2,-1,0,0,0,0,0,0,0,1,2,3]
y = [0,0,0,-3,-2,-1,0,1,2,3,0,0,0]
z = fltarr(n_elements(x))
r = 0.5

range = [min([x,y,z])-r, max([x,y,z])+r]

; Define plotting symbol and scale.
orb = obj_new('orb', COLOR=[40, 40, 40])
orb->Scale, r, r, r
oSymbol = obj_new('IDLgrSymbol', orb)

; Plot
xplot3d, x,y,z, linestyle=6, symbol=oSymbol,
xrange=range,yrange=range,zrange=range


With this, because I scale the orb to the radius of my spherule, it
plots at the correct size. However, because plot3d appears to scale
relative to the height/width of the window, I cannot get the symbol
size correct and it's driving me crazy!

New attempt:

new_orb = obj_new('orb',color = [40, 40, 40] )
new_orb->scale, r, r, r
p = plot3d(x,y,z,linestyle=6, /isotropic, sym_object=new_orb, sym_size
= 1 )


Changing the sym_size and the scaling does not give obvious results...
Does anyone know how to set the correct symbol size (i.e. so that the
radius of a sphere is set to my variable r)?

Cheers,
Andy
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: way to get actual axis range
Next Topic: Can't set brakpoints using emacs idlwave_shell

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

Current Time: Wed Oct 08 11:40:03 PDT 2025

Total time taken to generate the page: 0.00568 seconds