Ignore:
Timestamp:
07/07/06 11:57:27 (18 years ago)
Author:
navarro
Message:

english and nicer header (1)

Location:
trunk/SRC/Colors
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Colors/colorbar.pro

    r132 r133  
    11;+ 
    2 ; NAME: 
    3 ;   COLORBAR 
    4 ; 
    5 ; PURPOSE: 
    6 ;       The purpose of this routine is to add a color bar to the current 
    7 ;       graphics window. 
    8 ; 
    9 ; CATEGORY: 
    10 ;       Graphics, Widgets. 
    11 ; 
    12 ; CALLING SEQUENCE: 
    13 ;       COLORBAR 
    14 ; 
    15 ; INPUTS: 
    16 ;       None. 
    17 ; 
    18 ; KEYWORD PARAMETERS: 
    19 ; 
    20 ;       BOTTOM: The lowest color index of the colors to be loaded in 
     2; 
     3; @file_comments  
     4; The purpose of this routine is to add a color bar to the current 
     5; graphics window. 
     6; 
     7; @categories Graphics, Widgets. 
     8; 
     9; @keyword BOTTOM The lowest color index of the colors to be loaded in 
    2110;                 the bar. 
    2211; 
    23 ;       CB_CHARSIZE: The character size of the color bar annotations. Default is 1.0. 
    24 ; 
    25 ;       CB_CHARTICK: The character thick of the color bar annotations. Default is 1.0. 
    26 ; 
    27 ;       CB_COLOR:    The color index of the bar outline and characters. Default 
     12; @keyword CB_CHARSIZE The character size of the color bar annotations. Default is 1.0. 
     13; 
     14; @keyword CB_CHARTICK The character thick of the color bar annotations. Default is 1.0. 
     15; 
     16; @keyword CB_COLOR The color index of the bar outline and characters. Default 
    2817;                 is ncolors - 1 + bottom. 
    2918; 
    30 ;       CB_LOG: to get logarithmic scale for the colorbar 
    31 ; 
    32 ;       CB_TITLE:    This is title for the color bar. The default is to have 
     19; @keyword CB_LOG to get logarithmic scale for the colorbar 
     20; 
     21; @keyword CB_TITLE This is title for the color bar. The default is to have 
    3322;                 no title. 
    3423; 
    35 ;       DISCRET:  Vecteur contenant les incices des couleurs a tracer en barre 
    36 ; de couleur. On obtient ainsi une barre de couleur discrete ne comportant que 
    37 ; les couleurs specifiees ds l'ordre ou elles apparaissent ds le vecteur. 
    38 ; 
    39 ;       DIVISIONS: The number of divisions to divide the bar into. There will 
     24; @keyword DISCRETE Vector which contain color's indexes to trace in a color bar. Therefore 
     25;               we obtain a discreet color bar which only contains specified colors in  
     26;               order where they appear in the vector 
     27; 
     28; @keyword DIVISIONS The number of divisions to divide the bar into. There will 
    4029;                 be (divisions + 1) annotations. The default is 2. 
    4130; 
    42 ;       FORMAT:   The format of the bar annotations. Default is '(F6.2)'. 
    43 ; 
    44 ;       CB_LABEL:    C''est un vecteur qui specifie la valeur des sticks 
    45 ;       presents dans la barre de couleur. Il permet qd on utilise 
    46 ;       DISCRET d''avoir des couleurs qui ne s''incrementent pas de 
    47 ;       facon regulieres. 
    48 ; 
    49 ;       MAX:      The maximum data value for the bar annotation. Default is 
     31; @keyword FORMAT The format of the bar annotations. Default is '(F6.2)'. 
     32; 
     33; @keyword CB_LABEL It is a vector who specifie sticks's value attend in the color bar. 
     34;                It allowes, when we use DISCREET, to have colors which don't increase  
     35;                by increments in a regular way. 
     36; 
     37; @keyword MAX The maximum data value for the bar annotation. Default is 
    5038;                 NCOLORS-1. 
    5139; 
    52 ;       MIN:      The minimum data value for the bar annotation. Default is 0. 
    53 ; 
    54 ;       NCOLORS: This is the number of colors in the color bar. 
    55 ; 
    56 ;       NOTITLE:  oblige a ne pas mettre de titre meme si cb_title est declare 
    57 ; 
    58 ;       POSITION: A four-element array of normalized coordinates in the same 
     40; @keyword MIN The minimum data value for the bar annotation. Default is 0. 
     41; 
     42; @keyword NCOLOR This is the number of colors in the color bar. 
     43; 
     44; @keyword NOTITLE Force to don't writte title even if CB_TITLE is declarerd. 
     45; 
     46; @keyword POSITION A four-element array of normalized coordinates in the same 
    5947;                 form as the POSITION keyword on a plot. Default is 
    6048;                 [0.88, 0.15, 0.95, 0.95] for a vertical bar and 
    6149;                 [0.15, 0.88, 0.95, 0.95] for a horizontal bar. 
    6250; 
    63 ;       PSCOLOR: This keyword is only applied if the output is being sent to 
     51; @keyword PSCOLOR This keyword is only applied if the output is being sent to 
    6452;                 a PostScript file. It indicates that the PostScript device 
    6553;                 is configured for color output. If this keyword is set, then 
     
    7462;                 are outputting to a color PostScript printer. 
    7563; 
    76 ;       RIGHT:    This puts the labels on the right-hand side of a vertical 
     64; @keyword RIGHT This puts the labels on the right-hand side of a vertical 
    7765;                 color bar. It applies only to vertical color bars. 
    7866; 
    79 ;       TOP:      This puts the labels on top of the bar rather than under it. 
     67; @keyword TOP This puts the labels on top of the bar rather than under it. 
    8068;                 The keyword only applies if a horizontal color bar is rendered. 
    8169; 
    82 ;       VERTICAL: Setting this keyword give a vertical color bar. The default 
     70; @keyword VERTICAL Setting this keyword give a vertical color bar. The default 
    8371;                 is a horizontal color bar. 
    8472; 
    85 ; COMMON BLOCKS: 
    86 ;       None. 
    87 ; 
    88 ; SIDE EFFECTS: 
    89 ;       Color bar is drawn in the current graphics window. 
    90 ; 
    91 ; RESTRICTIONS: 
    92 ;       The number of colors available on the display device (not the 
     73; @restrictions Color bar is drawn in the current graphics window. 
     74; 
     75; @restrictions The number of colors available on the display device (not the 
    9376;       PostScript device) is used unless the NCOLORS keyword is used. 
    9477; 
    95 ; EXAMPLE: 
    96 ;       To display a horizontal color bar above a contour plot, type: 
    97 ; 
    98 ;       LOADCT, 5, NCOLORS=100 
    99 ;       CONTOUR, DIST(31,41), POSITION=[0.15, 0.15, 0.95, 0.75], $ 
    100 ;          C_COLORS=INDGEN(25)*4, NLEVELS=25 
    101 ;       COLORBAR, NCOLORS=100 
    102 ; 
    103 ; MODIFICATION HISTORY: 
    104 ;       Written by: David Fanning, 10 JUNE 96. 
     78; @examples To display a horizontal color bar above a contour plot, type: 
     79; 
     80;       IDL> LOADCT, 5, NCOLORS=100 
     81;       IDL> CONTOUR, DIST(31,41), POSITION=[0.15, 0.15, 0.95, 0.75], $ 
     82;       IDL> C_COLORS=INDGEN(25)*4, NLEVELS=25 
     83;       IDL> COLORBAR, NCOLORS=100 
     84; 
     85; @history Written by: David Fanning, 10 JUNE 96. 
    10586;       10/27/96: Added the ability to send output to PostScript. DWF 
    10687;       11/4/96: Substantially rewritten to go to screen or PostScript 
     
    11394;       3/3/98:  ajout du keyword discret par 
    11495;                sebastien (smasson@lodyc.jussieu.fr) 
     96; 
     97; @version $Id$ 
     98; 
    11599;- 
    116100 
    117101PRO COLORBAR, BOTTOM=bottom, CB_CHARSIZE=cb_charsize, CB_CHARTHICK=cb_charthick $ 
    118102              , CB_COLOR=cb_color, $ 
    119               DIVISIONS=divisions, DISCRET=discret,CB_LABEL = cb_label, $ 
     103              DIVISIONS=divisions, DISCRETE=discrete,CB_LABEL = cb_label, $ 
    120104              FORMAT=format, POSITION=position, MAX=max, MIN=min, NCOLORS=ncolors, $ 
    121105              PSCOLOR=pscolor, CB_TITLE=cb_title, VERTICAL=vertical, TOP=top, RIGHT=right, CB_LOG = CB_log, _extra = ex 
     
    189173 
    190174   IF KEYWORD_SET(vertical) THEN BEGIN 
    191       IF KEYWORD_SET(discret) THEN begin 
    192          facteur=256/n_elements(discret) 
    193          discret=reform(replicate(1,facteur) # discret,facteur*n_elements(discret), /overwrite)  
    194          bar = REPLICATE(1B,10) # discret 
     175      IF KEYWORD_SET(discrete) THEN begin 
     176         facteur=256/n_elements(discrete) 
     177         discrete=reform(replicate(1,facteur) # discrete,facteur*n_elements(discrete), /overwrite)  
     178         bar = REPLICATE(1B,10) # discrete 
    195179      endif else  bar = REPLICATE(1B,10) # BINDGEN(256) 
    196180      IF N_ELEMENTS(position) EQ 0 THEN position = [0.88, 0.15, 0.95, 0.95] 
    197181   ENDIF ELSE BEGIN 
    198       IF KEYWORD_SET(discret) THEN begin 
    199          facteur=256/n_elements(discret) 
    200          discret=reform(replicate(1,facteur) # discret,facteur*n_elements(discret), /overwrite)  
    201          bar =  discret # REPLICATE(1B,10) 
     182      IF KEYWORD_SET(discrete) THEN begin 
     183         facteur=256/n_elements(discrete) 
     184         discrete=reform(replicate(1,facteur) # discrete,facteur*n_elements(discrete), /overwrite)  
     185         bar =  discrete # REPLICATE(1B,10) 
    202186      endif else bar = BINDGEN(256) # REPLICATE(1B, 10) 
    203187      IF N_ELEMENTS(position) EQ 0 THEN position = [0.15, 0.88, 0.95, 0.95] 
     
    205189 
    206190                                ; Scale the color bar. 
    207    IF NOT KEYWORD_SET(discret) THEN $ 
     191   IF NOT KEYWORD_SET(discrete) THEN $ 
    208192    bar = BYTSCL(bar, TOP=ncolors-1) + bottom 
    209193 
Note: See TracChangeset for help on using the changeset viewer.