; docformat = 'rst' ;+ ; This is an example program to demontrate how to create a dot plot ; with Coyote Graphics routines. ; ; :Categories: ; Graphics ; ; :Examples: ; Save the program as "dot_plot.pro" and run it like this:: ; IDL> .RUN dot_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, 23 January 2013 by David W. Fanning. ; ; :Copyright: ; Copyright (c) 2013, Fanning Software Consulting, Inc. ;- PRO Dot_Plot ; Set up variables for the plot. Normally, these values would be ; passed into the program as positional and keyword parameters. labels = [ 'Exxon Mobil', $ 'Wal-Mart', $ 'Chevron', $ 'ConocoPhillips', $ 'General Electric', $ 'General Motors', $ 'Ford Motor', $ 'At&T', $ 'Hewlett-Packard', $ 'Bank of America' ] values = [ 120, 135, 139, 142, 170, 193, 247, 325, 367, 418] ; Draw the dot plot. cgDotPlot, labels, values, SymSize=1.5, PSym=16, XStyle=1, $ Title='Fortune 500 Companies', XTitle='Millions in Revenue', $ Color='red', AxisColor='navy', PlotFillColor='rose', XRange=[80,450] END ;***************************************************************** ; This main program shows how to call the program and produce ; various types of output. ; Display the plot in a graphics window. Dot_Plot ; Display the plot in a resizeable graphics window. cgWindow, 'Dot_Plot', WTitle='Dot Plot in a Resizeable Graphics Window' ; Create a PostScript file. cgPS_Open, 'dot_plot.ps' Dot_Plot cgPS_Close ; Create a PNG file with a width of 600 pixels. cgPS2Raster, 'dot_plot.ps', /PNG, Width=600 END