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

Home » Public Forums » archive » Re: Two quick questions
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
Re: Two quick questions [message #13114] Fri, 09 October 1998 00:00
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Colin Rosenthal wrote:
>
> 1) What happened to the libraries that used to be at
> http://xlr8.lpl.arizona.edu/idl.html
>
> 2) Does anyone have any nice collections of user plotting symbols I could
> steal.
>
You can check out my function sym.pro (attached below).
Usage: plot,x,y,psym=sym(N)

Martin.

--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------

;----------------------------------------------------------- --
;+
; NAME:
; SYM
;
; PURPOSE:
; define a standard sequence of plotting symbols
;
; CATEGORY:
; utility
;
; CALLING SEQUENCE:
; SYM, NUMBER
;
; INPUTS:
; NUMBER -> symbol number
;
; 0 : dot
; 1 : filled circle
; 2 : filled upward triangle
; 3 : filled downward triangle
; 4 : filled diamond
; 5 : filled square
; 6 : open circle
; 7 : open upward triangle
; 8 : open downward triangle
; 9 : open diamond
; 10 : open square
; 11 : plus
; 12 : X
; 13 : star
; 14 : filled rightfacing triangle
; 15 : filled leftfacing triangle
; 16 : open rightfacing triangle
; 17 : open leftfacing triangle
;
; KEYWORD PARAMETERS:
;
; OUTPUTS:
; function returns the symbol number to be used with PSYM= in the
; PLOT command
;
; SUBROUTINES:
;
; REQUIREMENTS:
;
; NOTES:
; This function produces a side effect in that the USERSYM procedure
; is used to create a symbol definition. It's meant for usage within
; the PLOT, OPLOT, etc. command
;
; EXAMPLE:
; PLOT,X,Y,PSYM=SYM(0),SYMSIZE=3
; produces a plot with dots (standard symbol 3)
; FOR I=0,17 DO OPLOT,X+1,Y,PSYM=SYM(I),COLOR=I
; overplots 17 curves each with its own symbol
;
; MODIFICATION HISTORY:
; mgs, 22 Aug 1997: VERSION 1.00
;
;-
; Copyright (C) 1997, Martin Schultz, Harvard University
; This software is provided as is without any warranty
; whatsoever. It may be freely used, copied or distributed
; for non-commercial purposes. This copyright notice must be
; kept with any copy of this software. If this software shall
; be used commercially or sold as part of a larger package,
; please contact the author to arrange payment.
; Bugs and comments should be directed to mgs@io.harvard.edu
; with subject "IDL routine sym"
;----------------------------------------------------------- --


function sym,number

on_error,2 ; return to caller


if(n_elements(number) eq 0) then return,1 ; default



result=8 ; default: return psym=8, i.e. user defined symbol

; define some help variables for
; circle :
phi=findgen(32)*(!PI*2/32.)
phi = [ phi, phi(0) ]


case number of

0 : result = 3 ; dot

1 : usersym, cos(phi), sin(phi), /fill
; filled circle

2 : usersym, [ -1, 0, 1, -1 ], [ -1, 1, -1, -1 ], /fill
; filled upward triangle

3 : usersym, [ -1, 0, 1, -1 ], [ 1, -1, 1, 1 ], /fill
; filled downward triangle

4 : usersym, [ 0, 1, 0, -1, 0 ], [ 1, 0, -1, 0, 1 ], /fill
; filled diamond

5 : usersym, [ -1, 1, 1, -1, -1 ], [ 1, 1, -1, -1, 1 ], /fill
; filled square

6 : usersym, cos(phi), sin(phi)
; open circle

7 : usersym, [ -1, 0, 1, -1 ], [ -1, 1, -1, -1 ]
; open upward triangle

8 : usersym, [ -1, 0, 1, -1 ], [ 1, -1, 1, 1 ]
; open downward triangle

9 : usersym, [ 0, 1, 0, -1, 0 ], [ 1, 0, -1, 0, 1 ]
; open diamond

10 : usersym, [ -1, 1, 1, -1, -1 ], [ 1, 1, -1, -1, 1 ]
; open square

11 : result = 1 ; plus

12 : result = 7 ; X

13 : result = 2 ; star

14 : usersym, [ -1, 1, -1, -1 ], [1, 0, -1, 1 ], /fill
; rightfacing triangle, filled

15 : usersym, [ 1, -1, 1, 1 ], [1, 0, -1, 1 ], /fill
; leftfacing triangle, filled

16 : usersym, [ -1, 1, -1, -1 ], [1, 0, -1, 1 ]
; rightfacing triangle, open

17 : usersym, [ 1, -1, 1, 1 ], [1, 0, -1, 1 ]
; leftfacing triangle, open

else : begin
print,'invalid symbol number - set to 1'
result = 1
end

endcase

return,result
end
  • Attachment: sym.pro
    (Size: 4.27KB, Downloaded 76 times)
Re: Two quick questions [message #13119 is a reply to message #13114] Thu, 08 October 1998 00:00 Go to previous message
rosentha is currently offline  rosentha
Messages: 23
Registered: November 1994
Junior Member
On 8 Oct 1998 15:35:54 GMT,
Colin Rosenthal <rosentha@asp.hao.ucar.edu> wrote:
> 1) What happened to the libraries that used to be at
> http://xlr8.lpl.arizona.edu/idl.html
>
> 2) Does anyone have any nice collections of user plotting symbols I could
> steal.

Ok, found both at
http://www.astro.washington.edu/deutsch/idl/htmlhelp/index.h tml

--
Colin Rosenthal
High Altitude Observatory
Boulder, Colorado
rosentha@hao.ucar.edu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to use _EXTRA convention
Next Topic: using tvscl??

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

Current Time: Wed Oct 08 17:36:20 PDT 2025

Total time taken to generate the page: 0.00260 seconds