home *** CD-ROM | disk | FTP | other *** search
- ; This batch file creates a plot used in Chapter 10, "Plotting",
- ; of _Using IDL_.
-
- ; Define variables.
-
- @plot01
-
- ; Draw axes with no data, setting the data range.
-
- PLOT, YEAR, CHINOOK, YRANGE = [MIN(SOCKEYE), MAX(CHINOOK)], /NODATA, $
- TITLE='Chinook and Sockeye Populations', XTITLE='Year', $
- YTITLE='Fish (thousands)'
-
- ; Make a vector of x values for the polygon by duplicating the first
- ; and last points.
-
- PXVAL = [YEAR(0), YEAR, YEAR(N1)]
-
- ; Get y value along bottom x-axis.
-
- MINVAL = !Y.CRANGE(0)
-
- ; Make a polygon by extending the edges of the math score down
- ; to the x-axis.
-
- POLYFILL, PXVAL, [MINVAL, CHINOOK, MINVAL], $
- COL = 0.75 * !D.N_COLORS
-
- ; Do the same with the verbal score.
-
- POLYFILL, PXVAL, [MINVAL, SOCKEYE, MINVAL], $
- COL = 0.50 * !D.N_COLORS
-
- ; Label the polygons.
-
- XYOUTS, 1968, 430, 'SOCKEYE', SIZE=2
- XYOUTS, 1968, 490, 'CHINOOK', SIZE=2
-