source: trunk/SRC/ToBeReviewed/PLOTS/style.pro @ 142

Last change on this file since 142 was 142, checked in by navarro, 18 years ago

english and nicer header (2a)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @file_comments
7; Choose the way to trace isolines.
8;
9; @categories
10; graphic
11;
12; @param LABSTYLE {in}{required}
13; Number to which the style of drawing choosen refer to.
14;       
15; @param LEVEL_Z2D {in}{required}
16; Vector containing values of isolignes to be traced.
17;
18; @param LINESTYLE {out}
19; Vector used to define the isocontour's style
20;       Comment: remenber:
21;               Index   Linestyle       
22;               0       Solid   
23;               1       Dotted 
24;               2       Dashed 
25;               3       Dash Dot       
26;               4       Dash Dot Dot Dot       
27;               5       Long Dashes     
28;
29; @param THICK {out}
30; Vector defining the thick of the isoline.
31;
32; @history
33; Sebastien Masson (smasson@lodyc.jussieu.fr)
34;
35; @version
36; $Id$
37;
38;-
39;------------------------------------------------------------
40;------------------------------------------------------------
41;------------------------------------------------------------
42pro style,labstyle,level_z2d,linestyle,thick
43;
44  compile_opt idl2, strictarrsubs
45;
46   case labstyle of
47      0: begin
48;series: Two thin continuous lines, one boldface continuous line
49         thick=[1,1,2]
50         linestyle=[0]
51         return
52      end
53      1: begin
54;series: Before the middle of levels: thin dash. Then thin continuous trait.
55; If the middle of the drawing is drawn, it is in boldface continuous trait.
56         impair=n_elements(level_z2d)-2*fix(n_elements(level_z2d)/2)
57         a=replicate(0,fix(n_elements(level_z2d)/2))
58         b=replicate(1,fix(n_elements(level_z2d)/2))
59         c=replicate(2,fix(n_elements(level_z2d)/2))         
60         if impair then begin
61            thick=[b,2,b]
62            linestyle=[c,0,a]
63         endif else begin
64            thick=[0]
65            linestyle=[c,a]
66         endelse
67         return
68      end
69      2: begin
70;series: Before the sill (defined by answering to a question): thin dash.
71; Then thin continuous trait. If the sill is drawn, it is in boldface continuous trait.
72         seuil=xquestion('Quelle est la limite tirets/trait continu? ','0')
73         seuil = float(seuil)
74         rien=where(level_z2d lt seuil,n)
75         a=replicate(0,n_elements(level_z2d)-n)
76         c=replicate(2,n)         
77         if seuil eq level_z2d[n] then begin
78            thick=[replicate(1,n),2,replicate(1,n_elements(level_z2d)-1-n)]
79            linestyle=[c,a]
80         endif else begin
81            thick=[0]
82            linestyle=[c,a]
83         endelse
84         return
85      end
86      3: begin
87         n = n_elements(level_z2d)
88         seuil = level_z2d[1+n/2]
89
90         thick = intarr(n)
91         thick[indgen(n/4)*4] = 1
92         thick[indgen(n/4)*4+1] = 1
93         thick[indgen(n/4)*4+2] = 2
94         thick[indgen(n/4)*4+3] = 1
95
96         linestyle = intarr(n)
97         linestyle[indgen(n/4)*4] = 3
98         linestyle[indgen(n/4)*4+1] = 0
99         linestyle[indgen(n/4)*4+2] = 0
100         linestyle[indgen(n/4)*4+3] = 0
101
102         labels = intarr(n)
103         labels[indgen(n/2)*2] = 1
104         labels[n/2] = 0
105
106         return
107      end
108      4: begin
109; Boldface continuous trait.
110         seuil = 1.e-6
111         thick=replicate(.5,  n_elements(level_z2d))
112         linestyle=[0]
113         rien=where(abs(level_z2d)/max(abs(level_z2d)) LT seuil)
114         if rien[0] NE -1 then thick[rien[0]] = 3
115      end
116      else: begin
117         ras = report('Le numero de labstyle demande n''existe pas')
118         stop
119      end
120   endcase
121   return
122end
Note: See TracBrowser for help on using the repository browser.