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
RevLine 
[2]1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
[142]6; @file_comments
7; Choose the way to trace isolines.
[2]8;
[142]9; @categories
10; graphic
[2]11;
[142]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.
[2]17;
[142]18; @param LINESTYLE {out}
19; Vector used to define the isocontour's style
20;       Comment: remenber:
[2]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     
[142]28;
29; @param THICK {out}
30; Vector defining the thick of the isoline.
[2]31;
[142]32; @history
33; Sebastien Masson (smasson@lodyc.jussieu.fr)
[2]34;
[142]35; @version
36; $Id$
[2]37;
38;-
39;------------------------------------------------------------
40;------------------------------------------------------------
41;------------------------------------------------------------
42pro style,labstyle,level_z2d,linestyle,thick
[114]43;
44  compile_opt idl2, strictarrsubs
45;
[2]46   case labstyle of
47      0: begin
[142]48;series: Two thin continuous lines, one boldface continuous line
[2]49         thick=[1,1,2]
50         linestyle=[0]
51         return
52      end
53      1: begin
[142]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.
[2]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
[142]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.
[2]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)         
[114]77         if seuil eq level_z2d[n] then begin
[2]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)
[114]88         seuil = level_z2d[1+n/2]
[2]89
90         thick = intarr(n)
[114]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
[2]95
96         linestyle = intarr(n)
[114]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
[2]101
102         labels = intarr(n)
[114]103         labels[indgen(n/2)*2] = 1
104         labels[n/2] = 0
[2]105
106         return
107      end
108      4: begin
[142]109; Boldface continuous trait.
[2]110         seuil = 1.e-6
[42]111         thick=replicate(.5,  n_elements(level_z2d))
[2]112         linestyle=[0]
113         rien=where(abs(level_z2d)/max(abs(level_z2d)) LT seuil)
[42]114         if rien[0] NE -1 then thick[rien[0]] = 3
[2]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.