; docformat = 'rst' ;+ ; This is an example program to demonstrate how to create a "fluence" plot ; with Coyote Graphics routines. ; ; :Categories: ; Graphics ; ; :Examples: ; Save the program as "fluence_plot.pro" and run it like this:: ; IDL> .RUN fluence_plot ; ; :Author: ; FANNING SOFTWARE CONSULTING:: ; David W. Fanning ; 1645 Sheely Drive ; Fort Collins, CO 80526 USA ; Phone: 970-221-0438 ; E-mail: david@idlcoyote.com ; Coyote's Guide to IDL Programming: http://www.idlcoyote.com ; ; :History: ; Change History:: ; Written, 12 June 2013 by David W. Fanning. ; ; :Copyright: ; Copyright (c) 2013, Fanning Software Consulting, Inc. ;- PRO Fluence_Plot ; Create some example data to plot. data = Gaussian_Function([3,6], Width=21) data = 1.0 - data x = Scale_Vector(Findgen(21), -4, 4) y = Scale_Vector(Findgen(21), -4, 4) ; Load program colors. cgLoadCT, 4, /Brewer, /Reverse ; Create a position for the surface in the display window. pos = [0.1, 0.1, 0.9, 0.75] ; With surfaces, the charsize often needs to be adjusted in PostScript. thisCharSize = (!D.Name EQ 'PS') ? cgDefCharsize()*1.75 : cgDefCharsize() ; Draw the fluence surface plot as a shaded surface. cgSurf, data, x, y, RotX=80, RotZ=45, Position=pos, /Elevation, ZStyle=4, $ /Shaded, ZTickformat='(A1)', XTitle='X Location (cm)', YTitle='Y Location (cm)', $ Charsize=thisCharSize ; Overlay the surface lines and add a skirt. cgSurf, data, x, y, RotX=80, RotZ=45, Position=pos, Skirt=Min(data), $ XTickformat='(A1)', YTickformat='(A1)', ZStyle=4, /NoErase, Color='dark gray', $ Charsize=thisCharSize ; Add a color bar to the plot. cgColorbar, Range=[0,1], Title='Normalized Fluence', TLocation='top', $ Position=[0.86, 0.15, 0.91, 0.85], Charsize=thisCharSize*0.8 END ;***************************************************************** ; This main program shows how to call the program and produce ; various types of output. ; Display the plot in a graphics window. Fluence_Plot ; Display the plot in a resizeable graphics window. cgWindow, 'Fluence_Plot', WBackground='White', $ WTitle='Fluence Plot in a Resizeable Graphics Window' ; Create a PostScript file. cgPS_Open, 'fluence_plot.ps', Font=1 Fluence_Plot cgPS_Close ; Create a PNG file with a width of 600 pixels. cgPS2Raster, 'fluence_plot.ps', /PNG, Width=600 END ;*****************************************************************