Changeset 299


Ignore:
Timestamp:
10/08/07 14:18:43 (17 years ago)
Author:
smasson
Message:

update the use of style

Location:
trunk/SRC/ToBeReviewed/PLOTS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/PLOTS/DESSINE/plt.pro

    r295 r299  
    151151; 
    152152; @keyword STYLE {default=style=0} 
    153 ; Contour's style to adopt to draw isolines. 
     153; Contour's style to adopt to draw isolines. See <pro>style</pro> for more informations 
    154154; 
    155155; @keyword VECTEUR {type=struct} 
  • trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltt.pro

    r297 r299  
    154154; 
    155155; @keyword STYLE {default=style=0} 
    156 ; Contour's style to adopt to draw isolines 
     156; Contour's style to adopt to draw isolines. See <pro>style</pro> for more informations 
    157157; 
    158158; @keyword STY1D 
  • trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro

    r297 r299  
    133133; 
    134134; @keyword STYLE {default=style=0} 
    135 ; Contour's style to adopt to draw isolines 
     135; Contour's style to adopt to draw isolines. See <pro>style</pro> for more informations 
    136136; 
    137137; @keyword WDEPTH 
  • trunk/SRC/ToBeReviewed/PLOTS/style.pro

    r262 r299  
     1;+ 
     2; 
     3; @hidden 
     4; 
     5;- 
     6PRO thresholdstyle, limit, ltlstyle, gtlstyle, level_z2d, linestyle, thick 
     7; 
     8  compile_opt idl2, strictarrsubs 
     9; 
     10  dummy = where(level_z2d lt limit, n) 
     11  IF n GT 0 THEN BEGIN 
     12    IF limit EQ level_z2d[n < (n_elements(level_z2d) -1)] THEN BEGIN 
     13      thick     = [replicate(1,        n), 2, replicate(1,        1 > (n_elements(level_z2d)-1-n))] 
     14      linestyle = [replicate(ltlstyle, n), 0, replicate(gtlstyle, 1 > (n_elements(level_z2d)-1-n))] 
     15    ENDIF ELSE BEGIN 
     16      thick = [0] 
     17      linestyle = [replicate(ltlstyle, n), replicate(gtlstyle, 1 > (n_elements(level_z2d) -n))] 
     18    ENDELSE 
     19  ENDIF ELSE BEGIN 
     20    IF limit EQ level_z2d[n] THEN BEGIN 
     21      thick = [2, replicate(1, 1 > (n_elements(level_z2d)-1))] 
     22      linestyle = [0, replicate(gtlstyle, 1 > (n_elements(level_z2d)-1))] 
     23    ENDIF ELSE BEGIN 
     24      thick = [1] 
     25      linestyle = [gtlstyle] 
     26    ENDELSE 
     27  ENDELSE 
     28return 
     29end 
    130;+ 
    231; 
    332; @file_comments 
    4 ; Choose the way to trace isolines. 
     33; Choose the linestyle to trace iso-contour 
     34; (Will define the keywords c_linestyle and c_thick) 
    535; 
    636; @categories 
     
    838; 
    939; @param LABSTYLE {in}{required} 
    10 ; Number to which the style of drawing choosen refer to. 
     40; 
     41; Two kind of labelstyle are accepted: 
     42; 
     43; 1) A number referring to the existing choices: 
     44;    0 : Two thin continuous lines, one bold continuous line... 
     45;    1 : before the middle of levels: thin dash. Then thin continuous 
     46;        line. and bold for the middle 
     47;    2 : Same as case 1 but threshold value is defined by the user 
     48;        by answering a question 
     49;    3 : Solid-Bold, solid-thin, dash Dot-thin, solid-thin, Solid-Bold... 
     50;    4 : Solid-very-thin, except for contour O, that is solid-bold 
     51; 2) for the labelstyle based on a threshold value (with a style 
     52;before and after the threshold value and a bold solid line for the 
     53;value itself, a more general definition can be given with a scalar 
     54;string with the following structure: 'xxNN...NNyy' with   
     55; xx and yy correspondind to one the following choices (with the corresponding meaning) 
     56;               so -> Solid      
     57;               do -> Dotted     
     58;               da -> Dashed     
     59;               dd -> Dash Dot   
     60;               ld -> Long Dashes 
     61; and NN...NN any kind of number that will define the threshold value. 
     62; for example 'do-6.6so' will do dotted line until -6.6 and solid line after.  
    1163;        
    1264; @param LEVEL_Z2D {in}{required} 
     
    1466; 
    1567; @param LINESTYLE {out} 
    16 ; Vector used to define the isocontour's style 
    17 ;       Comment: remember: 
    18 ;               Index   Linestyle        
    19 ;               0       Solid    
    20 ;               1       Dotted   
    21 ;               2       Dashed   
    22 ;               3       Dash Dot         
    23 ;               4       Dash Dot Dot Dot         
    24 ;               5       Long Dashes      
     68; Used interbally by plt(z)(t) to define c_linestyle when calling pltbase. 
     69; Vector used to define the isocontour's style.  
    2570; 
    2671; @param THICK {out} 
    27 ; Vector defining the thick of the isoline. 
     72; Used interbally by plt(z)(t) to define c_thick when calling pltbase. 
     73; Vector used to define the isocontour's thickness.  
    2874; 
    2975; @history 
    3076; Sebastien Masson (smasson\@lodyc.jussieu.fr) 
     77; Oct 2007 revisiting... 
    3178; 
    3279; @version 
     
    3986  compile_opt idl2, strictarrsubs 
    4087; 
    41    case labstyle of 
    42       0: begin 
    43 ;series: Two thin continuous lines, one boldface continuous line 
    44          thick=[1,1,2] 
    45          linestyle=[0] 
    46          return 
    47       end 
    48       1: begin 
    49 ;series: Before the middle of levels: thin dash. Then thin continuous trait. 
    50 ; If the middle of the drawing is drawn, it is in boldface continuous trait. 
    51          impair=n_elements(level_z2d)-2*fix(n_elements(level_z2d)/2) 
    52          a=replicate(0,fix(n_elements(level_z2d)/2)) 
    53          b=replicate(1,fix(n_elements(level_z2d)/2)) 
    54          c=replicate(2,fix(n_elements(level_z2d)/2)) 
    55          if impair then begin 
    56             thick=[b,2,b] 
    57             linestyle=[c,0,a] 
    58          endif else begin 
    59             thick=[0] 
    60             linestyle=[c,a] 
    61          endelse 
    62          return 
    63       end 
    64       2: begin 
    65 ;series: Before the sill (defined by answering to a question): thin dash. 
     88; Just to remember.. there is the codes for c_linestyle 
     89;               0       Solid    
     90;               1       Dotted   
     91;               2       Dashed   
     92;               3       Dash Dot         
     93;               4       Dash Dot Dot Dot         
     94;               5       Long Dashes 
     95;        
     96  IF size(labstyle, /type) EQ 7 THEN BEGIN 
     97    CASE strlowcase(strmid(labstyle, 0, 2)) OF 
     98      'so':ltlstyle = 0 
     99      'do':ltlstyle = 1 
     100      'da':ltlstyle = 2 
     101      'dd':ltlstyle = 3 
     102      'ld':ltlstyle = 5 
     103    ENDCASE 
     104    CASE strlowcase(strmid(labstyle, 1, 2, /reverse_offset)) OF 
     105      'so':gtlstyle = 0 
     106      'do':gtlstyle = 1 
     107      'da':gtlstyle = 2 
     108      'dd':gtlstyle = 3 
     109      'ld':gtlstyle = 5 
     110    ENDCASE 
     111    limit = float(strmid(labstyle, 2, strlen(labstyle)-4)) 
     112    thresholdstyle, limit, ltlstyle, gtlstyle, level_z2d, linestyle, thick 
     113  ENDIF ELSE BEGIN 
     114    CASE labstyle OF 
     115      0: BEGIN 
     116; Two thin continuous lines, one bold continuous line 
     117        thick = [1, 1, 2] 
     118        linestyle = [0] 
     119      END 
     120      1: BEGIN 
     121; Before the middle of levels: thin dash. Then thin continuous line. 
     122; If the middle of the drawing is drawn, it is in bold continuous line. 
     123        odd = n_elements(level_z2d)-2*fix(n_elements(level_z2d)/2) 
     124        zero = replicate(0, fix(n_elements(level_z2d)/2)) 
     125        one = replicate(1, fix(n_elements(level_z2d)/2)) 
     126        two = replicate(2, fix(n_elements(level_z2d)/2)) 
     127        IF odd THEN BEGIN 
     128          thick = [one, 2, one] 
     129          linestyle = [two, 0, zero] 
     130        ENDIF ELSE BEGIN 
     131          thick = [0] 
     132          linestyle = [two, zero] 
     133        ENDELSE 
     134      END 
     135      2: BEGIN 
     136; Before the threshold (defined by answering to a question): thin dash. 
    66137; Then thin continuous trait. If the sill is drawn, it is in boldface continuous trait. 
    67          seuil=xquestion('Quelle est la limite tirets/trait continu? ','0') 
    68          seuil = float(seuil) 
    69          rien=where(level_z2d lt seuil,n) 
    70          a=replicate(0,n_elements(level_z2d)-n) 
    71          c=replicate(2,n) 
    72          if seuil eq level_z2d[n] then begin 
    73             thick=[replicate(1,n),2,replicate(1,n_elements(level_z2d)-1-n)] 
    74             linestyle=[c,a] 
    75          endif else begin 
    76             thick=[0] 
    77             linestyle=[c,a] 
    78          endelse 
    79          return 
    80       end 
     138        limit = xquestion('What is the threshold value between dashed and continues line? ', '0') 
     139        limit = float(limit) 
     140        thresholdstyle, limit, 2, 0, level_z2d, linestyle, thick 
     141      END 
     142; Solid-Bold, solid-thin, dash Dot-thin, solid-thin, Solid-Bold...     
    81143      3: begin 
    82          n = n_elements(level_z2d) 
    83          seuil = level_z2d[1+n/2] 
    84  
    85          thick = intarr(n) 
    86          thick[indgen(n/4)*4] = 1 
    87          thick[indgen(n/4)*4+1] = 1 
    88          thick[indgen(n/4)*4+2] = 2 
    89          thick[indgen(n/4)*4+3] = 1 
    90  
    91          linestyle = intarr(n) 
    92          linestyle[indgen(n/4)*4] = 3 
    93          linestyle[indgen(n/4)*4+1] = 0 
    94          linestyle[indgen(n/4)*4+2] = 0 
    95          linestyle[indgen(n/4)*4+3] = 0 
    96  
    97          labels = intarr(n) 
    98          labels[indgen(n/2)*2] = 1 
    99          labels[n/2] = 0 
    100  
    101          return 
     144        n = n_elements(level_z2d) 
     145        limit = level_z2d[1+n/2] 
     146        thick = intarr(n) 
     147        thick[indgen(n/4)*4] = 1 
     148        thick[indgen(n/4)*4+1] = 1 
     149        thick[indgen(n/4)*4+2] = 2 
     150        thick[indgen(n/4)*4+3] = 1 
     151        linestyle = intarr(n) 
     152        linestyle[indgen(n/4)*4] = 3 
     153        linestyle[indgen(n/4)*4+1] = 0 
     154        linestyle[indgen(n/4)*4+2] = 0 
     155        linestyle[indgen(n/4)*4+3] = 0 
    102156      end 
    103157      4: begin 
    104158; Boldface continuous trait. 
    105          seuil = 1.e-6 
    106          thick=replicate(.5,  n_elements(level_z2d)) 
    107          linestyle=[0] 
    108          rien=where(abs(level_z2d)/max(abs(level_z2d)) LT seuil) 
    109          if rien[0] NE -1 then thick[rien[0]] = 3 
     159        limit = 1.e-6 
     160        thick = replicate(.5,  n_elements(level_z2d)) 
     161        linestyle = [0] 
     162        rien = where(abs(level_z2d)/max(abs(level_z2d)) LT limit) 
     163        if rien[0] NE -1 then thick[rien[0]] = 3 
    110164      end 
    111165      else: begin 
    112          ras = report('Le numero de labstyle demande n''existe pas') 
    113          stop 
     166        ras = report('Bab value of the style (can be from 0 to 4 or a scalar string)') 
     167        stop 
    114168      end 
    115    endcase 
    116    return 
     169    endcase 
     170  ENDELSE  
     171 
     172 
     173  return 
    117174end 
Note: See TracChangeset for help on using the changeset viewer.