1 | ;+ |
---|
2 | ; @file_comments |
---|
3 | ; figure 1: basics plots |
---|
4 | ; plot and contours |
---|
5 | ; |
---|
6 | ; @history |
---|
7 | ; Sebastien Masson may 2005 |
---|
8 | ; |
---|
9 | ; @version $Id$ |
---|
10 | ;- |
---|
11 | PRO tst_basic |
---|
12 | ; |
---|
13 | ; 1) plot |
---|
14 | ; |
---|
15 | compile_opt idl2, strictarrsubs |
---|
16 | ; |
---|
17 | n = 10 |
---|
18 | y = findgen(n) |
---|
19 | ; basic plot |
---|
20 | splot, y, small = [2, 2, 1], /portrait |
---|
21 | ; improved plot by using plot and "graphic keywords" |
---|
22 | splot, y, small = [2, 2, 2], /noerase, yrange = [0, (n-1)^2], title = 'x and x^2' |
---|
23 | oplot, y^2, color = 100, linestyle = 2, thick = 3 |
---|
24 | ; |
---|
25 | ; 2) contour |
---|
26 | ; |
---|
27 | z = dist(n) |
---|
28 | ; basic plot |
---|
29 | scontour, z, /fill, nlevels = 15, small = [2, 2, 3], /noerase |
---|
30 | ; improved plot by using contour and "graphic keywords" |
---|
31 | ind = findgen(2*n)/(2.*n) |
---|
32 | scontour, z, levels = n*ind, c_orientation = 180*ind, c_spacing = .2*ind $ |
---|
33 | , small = [2, 2, 4], /noerase |
---|
34 | contour, z, /overplot, c_label = rebin([1, 0], 2, n), levels = n*ind $ |
---|
35 | , c_charthick = 2, c_charsize = 1.5, c_colors = 250*ind |
---|
36 | return |
---|
37 | end |
---|