Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Ben Tupper (btupper@bigelow.org) writes: > Thanks for any thoughts on this, I've no thoughts on the matter. I think what you wrote sums the situation up nicely. Cheers, David P.S. For what's its worth, you can always write BT_PLOTS, which works the way PLOTS *should* work. That's what we do for TV with TVIMAGE, IMGDISP, PLOTIMAGE, and the like. :-) -- David W. Fanning, Ph.D. Fanning Software Consulting Phone: 970-221-0438, E-mail: david@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com/ Toll-Free IDL Book Orders: 1-888-461-0155
Hi, Here's my stab at it. I had the bright idea of using the name PlotSym. After I peeked at Eric D's database of IDL routines, I realized that was a well worn path and wasn't such a bright idea after all. So here's oPlotS which should work as a drop in replacement for PlotS. Ben David Fanning wrote: > > > P.S. For what's its worth, you can always > write BT_PLOTS, which works the way PLOTS > *should* work. That's what we do for TV > with TVIMAGE, IMGDISP, PLOTIMAGE, and the > like. :-) > > ;----START ;+ ; NAME: ; OPLOTS ; ; PURPOSE: ; This procedure serves as a wrapper around the PLOTS procedure. ; Symbol charcteristics PSYM, COLOR, THICK and SYMSIZE maybe ; specified as scalars, vectors or not at all. The default for each is the contents ; the relevent !P field. If there are more data points than elements in anyone ; of these keywords, then values of the keyword are cyclically repeated. ; ; CATEGORY: ; Direct graphics ; ; See online help for PLOTS for details. ; ; EXAMPLE: ; ;IDL> tek_color ;IDL> num = 50 ;IDL> x = findgen(num) ;IDL> y = x^2 ;IDL> PLOT, X, Y, /noData ;IDL> Color = Indgen(5)+3 ;IDL> Psym = [1,2,4,5,6] ;IDL> SymSIze = [0.5, 1.0, 2.0] ;IDL> Thick = [0.5, 1.0, 2.0] ;IDL> oPlotS, X, Y, Color = Color, Psym = Psym, Thick = Thick, SymSize = SymSize, /Data ; ; MODIFICATION HISTORY: ; 14 NOV 2001 ; Goaded into doing it by David Fanning. ; Ben Tupper ; pemaquidriver@tidewater.net ; ;- PRO oPlotS, X, Y, Z, $ PSym = Psym, Color = Color, $ SymSize = SymSize, Thick = Thick, $ _Extra = extra n = n_elements(X) nc = n_elements(color) If nc EQ 0 Then Begin Color = !P.Color nc = 1L EndIf ns = n_elements(SymSize) If ns EQ 0 Then Begin SymSize = !P.symsize ns = 1L EndIf np = n_elements(Psym) If np EQ 0 Then Begin Psym = !P.PSym np = 1L EndIf nt = n_elements(Thick) If nt EQ 0 Then Begin thick = !P.Thick nt = 1L EndIf Case n_params() of 2:For i = 0L, n-1 Do PlotS, X[i], Y[i], $ Color = Color[i MOD nc], $ Psym = Psym[i MOD np], $ Thick = Thick[i MOD nt], $ SymSize = SymSize[i MOD ns], $ _Extra = extra 3: For i = 0L, n-1 Do PlotS, X[i], Y[i], Z[i], $ Color = Color[i MOD nc], $ Psym = Psym[i MOD np], $ Thick = Thick[i MOD nt], $ SymSize = SymSize[i MOD ns], $ _Extra = extra ELSE: Message, 'Must provide 2 or 3 arguments!' EndCase Return END ;----END -- Ben Tupper 248 Lower Round Pond Road POB 106 Bristol, ME 04539 Tel: (207) 563-1048 Email: PemaquidRiver@tidewater.net