;+ ; NAME: ; TEMPLATE_FIG ; ; PURPOSE: ; Illustrate good figure making techniques ; ; CALLING SEQUENCE: ; ; TEMPLATE, [/PS, /EPS] ; ; ; OPTIONAL KEYWORD PARAMETERS: ; PS: Create postscript figure. ; Output file called 'template.ps' ; ; EPS: Create encapsulated postscript figure. ; Output file called 'template.eps' ; ; OUTPUTS: ; Plots to screen if no keywords are given. ; Creates template.ps or template.eps depending on keyword used. ; ; ROUTINES CALLED: ; kellepro:colors_kc.pro ; kellepro:symbols_kc.pro ; kellepro:symbols_ps_kc.pro ; ; EXAMPLES: ; ; Plot to screen ; ; TEMPLATE_FIG ; ; Create postscript output ; ; TEMPLATE_FIG, /ps ; ; ; MODIFICATION HISTORY: ; Written by: Kelle Cruz, November 2007 ; ;- PRO TEMPLATE_FIG, ps=ps,eps=eps ;------- ;load lots of colors ;------- @colors_kc if keyword_set(ps) then begin ext='.ps' endif else begin if keyword_set(eps) then begin ps = 1 ext='.eps' endif endelse IF KEYWORD_SET(ps) THEN BEGIN ;------- ;setup for postscript or eps output ;------- !p.font=0 ;use postscript fonts set_plot, 'ps' @symbols_ps_kc ;load string symbols and greek letters for Postscript device, filename='template'+ext, encapsulated=eps, $ /helvetica,/isolatin1, landscape=0, color=1 device, xsize=8.89, ysize=8.89 ;SQUARE one panel, one column figure ;device, xsize=18.6267, ysize=8.89 ;RECTANGLE two column figure cs=1 ;charcter size ENDIF ELSE BEGIN ;------- ;set up for display to screen ;------- device, Decomposed=0 ;make colors work for 24-bit display black=white ;exchange colors to work with default black background @symbols_kc ;load string symbols and greek letters for Hershey cs=2 ;charcter size ENDELSE ;------- ;make lines thick ;------- !p.thick=4 ;data !x.thick=3 ;x axis !y.thick=3 ;y axis a=findgen(100)/10. b=sin(a) plot, a,b,xtitle='Wavelength' + ' ('+micron +')',ytitle=Psi+'(x)',/nodata, charsize=cs oplot, a,b, color=red ;colors defined in color_kc.pro ;symbol names defined in symbols_kc.pro and symbols_ps_kc.pro test_string=Phi+Psi+Omega+'!C'+alpha+beta+delta+lambda+nu+pi+'!C'+$ leq+geq+times+propto+approx+degr+pm+oplus xyouts, 0.5,-0.5, test_string, color=blue,charsize=cs ;colors defined in color_kc.pro IF KEYWORD_SET(ps) THEN BEGIN device,/close set_plot,'x' !p.font=-1 ;go back to default (Vector Hershey fonts) ENDIF loadct,0 ;go back to default greyscale color table END