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