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

Home » Public Forums » archive » oplot for plots
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
oplot for plots [message #49809] Fri, 18 August 2006 06:32
Nic is currently offline  Nic
Messages: 5
Registered: June 2006
Junior Member
Hi all!

I am trying to draw 10 arrows randomly placed in the x-y plane to their
z(x,y) value.

Here is what I have tried so far:

PRO IMPULSE_2D
;This procedure produces a 2-D impulse function plot with 10 arrows.
; The number of arrows can be adjusted by the for loop.

; make graphics window plot
; 3-D sin function from p. 271 Practical IDL programming by Gumley
v=findgen(41)*.5-10
x=rebin(v, 41,41, /sample)
y=rebin(transpose(v), 41, 41, /sample)
r=sqrt(x^2+y^2)+1.0e-6
z=sin(r)/r
window, /free
surface, z, title='A 2-D impulse function', xtitle='x', ytitle='y',
charsize=2, /save, /nodata
for i=0, 9 do begin
index1=fix(round(randomu(seed1)*41))
index2=fix(round(randomu(seed2)*41))
plots, [index1,index2,0], [index1,index2,z[index1,index2]], /t3d
print, i
print, index1, index2
endfor
end

It is making lines (how do I get it to plot arrows?), but I think each
time the for loop runs, it is overwriting the previous loop's plots. I
want to overplot each new plots to the original surface plot.

Thanks for any help. (And thank you so much for all that help with the
dirac plot way back when!)

Nic
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Movie replacement
Next Topic: Re: Movie replacement

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

Current Time: Thu Oct 09 21:23:34 PDT 2025

Total time taken to generate the page: 0.72425 seconds