PRO PLOT_XY, x, y, XRANGE=xrange, YRANGE=yrange, TITLE=title, $ XTITLE=xtitle, YTITLE=ytitle, SUBTITLE=subtitle, $ TIME=time, EPS=eps, NOPRINT=noprint, $ FILE=fileName, PSYM=psym, SYMSIZE=symsize, $ THICK=thick, PLOTID=plotid, CLIP=clip, $ OVERPLOT=over ;=============================================================================== ; (c) 1991 - khd c/o FU BERLIN. A l l r i g h t s r e s e r v e d. || ; ** No part of this software package may be reproduced, transmitted, || ; 1992 transcribed, stored in a retrieval system, or translated into || ; any form by any means without the w r i t t e n permission of || ; Karl-Heinz Dittberner-FU BERLIN, Arnimallee 22, D-1000 Berlin 33 || ;=============================================================================== ; PRO:PLOT_XY.PRO K.-H. Dittberner - 31.JAN.1991 ; V 01.6 P 476/42 - 3.JUL.1992 ; ; IDL(V2.1)-Routine: Ausgabe eines XY-Plots in einem Standard-Format. ; ; HINWEISE: Die Ausgabe des Plots erfolgt in der PostScript- ; Beschreibung (PS oder EPS). ; ; KEYWORDS: * = Wie im IDL-Manual beschrieben. ; ; /CLIP = Datenausgabe wird auf den Plotbereich beschraenkt. ; /EPS = Ausgabe als Encapsulated PostScript Datei. ; FILE = Datei-Name fuer den Plot (Default="IDL.PS"/"IDL.EPS"). ; /NOPRINT = Plot soll nicht sofort gedruckt werden. ; OVERPLOT = Name einer 2. Variablen fuer ein Overplot mit PSYM=0. ; /PLOTID = Zu jedem Punkt wird der Indexwert (Nr.) geplottet. ; PSYM = Art des Symbols zur Datenpunktmarkierung. * ; SUBTITLE = Ein Untertitel fuer den Plot. * ; SYMSIZE = Relative Groesse des Symbols (Default=0.3). * ; THICK = Linienstaerke des Graphs (Default=5.0). * ; TIME = Zeitpunkt der Erzeugung des Plots. ; TITLE = Ueberschrift des Plots. * ; XRANGE = x-Plotbereich: [..., ...]. * ; XTITLE = Beschriftung an der x-Achse. * ; YRANGE = y-Plotbereich: [..., ...]. * ; YTITLE = Beschriftung an der y-Achse. * ; ; Quelle: Do-it-yourself! Merkposten: o ; o CRANGE (Clip) einfuehren ? ; Aufruf: PLOT_XY, x, y [, ...] o Abschluss bei EPS ? ; o fileName checken. ; o ;=============================================================================== ; Aenderungen: [12/3/91-khd] => V 01.1: ; - Experimentalfassung ist fertig. ; [26/6/92-khd] => V 01.2: ; - Bei PLOT das Keyword XSTYLE=1 entfernt. ; - Keywords PSYM + SYMSIZE implementiert. ; [29/6/92-khd] => V 01.3: (Copy => SEIDLER + WERNER) ; - Keywords THICK, XRANGE + YRANGE implementiert. ; [30/6/92-khd] => V 01.4: ; - Neues Keyword PLOTID implementiert. ; [2/7/92-khd] => V 01.5: ; - On_Error,2 aktiviert. (Copy => WERNER) ; - Alle Ticks nunmehr nach aussen. ; - Neues Keyword CLIP implementiert. ; [3/7/92-khd] => V 01.6: (Copy => AG GRUESSER, PRZY + DK) ; - Wenn nur mit 1 VAR aufgerufen, dann wird nunmehr diese ueber ; ihrem lfd. Index geplottet. ; - Neues Keyword OVERPLOT implementiert. ;=============================================================================== ; 1. Prolog, Variablen und Konstanten: ;=============================================================================== ; On_Error, 2 ; Return => Ruf. Programm. On_IOerror, IO_Error Old_Device = !D.Name Case N_Params() Of 1: Begin y = x x = IndGen(N_Elements(y)) End 2: ; Es wird y ueber x geplottet. Else: Message, "Anzahl der Argumente ist falsch." Endcase x_max = Max(x, Min=x_min) y_max = Max(y, Min=y_min) !X.TickLen = -0.02 !Y.TickLen = -0.02 ; ;=============================================================================== ; 2. Behandlung der Keywords (Default-Werte): ;=============================================================================== ; If Not Keyword_Set(xrange) then xrange = [x_min, x_max] If Not Keyword_Set(yrange) then yrange = [y_min, y_max] If Not Keyword_Set(clip) then noclip=1 else noclip=0 If Not Keyword_Set(title) then title = "" If Not Keyword_Set(subtitle) then subtitle = "" If Not Keyword_Set(xtitle) then xtitle = "" If Not Keyword_Set(ytitle) then ytitle = "" If Not Keyword_Set(thick) then thick = 5.0 If Not Keyword_Set(psym) then psym = 0 ; Linien. If Not Keyword_Set(symsize) then symsize = 0.3 If Not Keyword_Set(fileName) then fileName = "SYS$LOGIN:IDL" If Not Keyword_Set(time) then time = SysTime(0) ; ;=============================================================================== ; 3. Erzeugen des XY-Plots: ;=============================================================================== ; Set_Plot, "PS", /Copy ; Umschalten auf PostScript-Ausgabe. If Keyword_Set(eps) $ then Begin file = fileName + ".EPS" Device, /Encapsulated, FileName=file, /Times, $ /Italic, Font_Size=14 Endif $ else Begin file = fileName + ".PS" Device, FileName=file, /Times, /Italic, Font_Size=14 Endelse Plot, x, y, Xrange=xrange, Yrange=yrange, Xtitle=xtitle, Ytitle=ytitle, $ Font=0, Thick=thick, LineStyle=0, PSym=psym, SymSize=symsize, $ NoClip=noclip If Keyword_Set(over) $ then Begin OPlot, x, over, Thick=thick/2., LineStyle=0, PSym=0, NoClip=noclip Endif Device, /Times, /Bold, /Italic, Font_Size=12 XYouts, 0.55, 1.10, /Norm, title, Alignment=0.5, Font=0 Device, /Times, /Italic, Font_Size=8 XYouts, 0.55, 1.05, /Norm, "Creation-Date: "+time, Alignment=0.5, Font=0 XYouts, 0.55,-0.10, /Norm, subtitle, Alignment=0.5, Font=0 If Keyword_Set(plotid) $ then Begin nx = N_Elements(x) index = StrTrim(IndGen(nx)+1, 2) delta = (y_max - y_min)/60. Device, /Helvetica, Font_Size=8 For i=0,nx-1 Do Begin XYouts, x(i), y(i)+delta, index(i), Align=0.5, Font=0, $ NoClip=noclip Endfor Endif ; ;=============================================================================== ; 4. Ausgabe des XY-Plots: ;=============================================================================== ; If Keyword_Set(eps) $ then Device, /Close_File $ else If Keyword_Set(noprint) $ then Print_Plot, file, /NoPrint $ else Print_Plot, file Goto, Ende ; ;=============================================================================== ; 5. Schluss: ;=============================================================================== ; IO_Error: On_IOerror, null Print, !Err_String Ende: Set_Plot, Old_Device RETURN END ;===============================================================================