Changeset 142 for trunk/SRC/ToBeReviewed/PLOTS/DIVERS/placedessin.pro
- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/PLOTS/DIVERS/placedessin.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME:placedessin 6 ; 7 ; PURPOSE: mise en place du dessin / ouverture de la fenetre ou du PS 8 ; 9 ; CATEGORY: pour alleger les programmes plt, pltz, pltt. 10 ; 11 ; CALLING SEQUENCE: placedessin, typedessin,posfenetre, posbar 12 ; 13 ; INPUTS: 14 ; typedessin: une chaine de charactere specifiant quelle procedure 15 ; appelle placedessin: 'plt', 'pltz', 'pltt' 16 ; 17 ; KEYWORD PARAMETERS: pleins (ce de CALIBRE de WINDOW ...) 18 ; 19 ; LCT: intier designant le numero de la palette de couleur que 20 ; l''on veut utiliser pour les plot. 5 ; 6 ; @file_comments 7 ; Putting into place of the drawing/ opening of the window or of the PS 8 ; 9 ; @categories 10 ; Utilities 11 ; 12 ; @param TYPEDESSIN 13 ; It is a chain or characteres specifying what procedure is called by PLACEDESSIN: 'plt', 'pltz' or 'pltt' 14 ; 15 ; @keyword LANDSCAPE 16 ; Force the page or the window on the screen to be in lenthened position. 17 ; 18 ; @keyword LCT 19 ; Is an integer designating the number of the palette of color we want to use for the plot. 21 20 ; 22 ; OUTPUTS: 23 ; 24 ; posfenetre: un vecteur de 4 elements contenant la position de 25 ; cadre contenant les legendes + le graphe en coordonnes 26 ; normalises. Rq: pour positionner le dessin il faut apres 27 ; l''appelle de calibre faire !p.position=posfenetre 28 ; 29 ; posbar: cf posfentre mais pour la barre de couleur. meme 30 ; remarque pour positionner la barre de couleur, !p.position=posbar 31 ; 32 ; 33 ; COMMON BLOCKS: 34 ; common.pro 35 ; 36 ; SIDE EFFECTS: 37 ; 38 ; RESTRICTIONS: 39 ; 40 ; EXAMPLE: 41 ; 42 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 21 ; @keyword MAP 22 ; We use it when we want to do a projection. 23 ; This keyword can be of two types: 24 ; MAP=[P0lat,P0lon,Rot]. For the descrption of these 3 values (see the online help of MAP_SET). 25 ; /MAP: In this case, map is automatically caculated have the value: 26 ; map = [0, (lon1+lon2)/2., 0] 27 ; Comment: A good way to choose the type of the projection we want to do is to have a look at IDL demo: 28 ; IDL> demo 29 ; Then choose earth sciences and mapping. 30 ; Comment2: By default it is a cindrical projection which is effectuated (with or without the keyword map). 31 ; If we want an other projection, MAP must be activated and we have to add the keyword: /nom_projection. 32 ; For example, for a polar projection centered on the south pole: 33 ; IDL> domdef,-180,180,-90,-45 34 ; IDL> plt, tab, /stereo,map=[-90,0,0] 35 ; 36 ; @keyword NOCOLORBAR 37 ; We active it if we do not want the colorbar. 38 39 ;; @keyword NOFILL 40 ; We active it if we only want contours in black and white with a white background. 41 ; 42 ; @keyword NOERASE 43 ; We active it to make a drawing without creating a new frame. 44 ; 45 ; @keyword SMALL 46 ; Vector composed of 3 or 4 elements, applyed to make a drawing on a 47 ; small portion of a page or screen. It delimit the zone where the drawing will be done. 48 ; If there is 4 elements: 49 ; then is constituated of coordinates (expressed in cm located from the up and 50 ; left corner of the page or the window (in portrait like in lanscape)) of the bottom 51 ; and left corner and of the up and right corner of the drawing zone. 52 ; If there is 3 elements: 53 ; in this case, we divide the page or the screen in small[0] columns and in small[1] lines 54 ; the drawing made in the box numbered small[2]. The numerotation starting up and left by 55 ; the number 1 and then, following the writing direction. 56 ; By default, we make the largest drawing we can do, conserving the aspect rapport 57 ; (exept when REMPLI is activated). 58 ; 59 ; @keyword PORTRAIT 60 ; Force the page or the window to be in standing position. 61 ; 62 ; @keyword POST 63 ; Make a postscript. Only works if we made one drawing on the page. 64 ; If we make several drawing, use \@ps. 65 ; 66 ; @keyword REMPLI 67 ; Force the drawing to occupy the whole space defined by small. 68 ; 69 ; @keyword WINDOW 70 ; Number of the window on which we want to do the graph (Allow to open several windows). 71 ; By default, we open 'IDL0' 72 ; 73 ; @keyword CB_TITLE 74 ; The colorbar's title 75 ; 76 ; @keyword CONTOUR 77 ; If we want to trace contours of a different field than the one 78 ; whose we have the colored drawing (by examlpe E-P in color and QSR in contours). 79 ; It must be a field respecting same caracteristics than the argument number one of plt. 80 ; 81 ; @keyword ENDPOINTS 82 ; keyword specifing that we want to make a vertical cut in diagonal. Then coorinated of extremities 83 ; of these one are difined by the 4 elements of the vector ENDPOINTS: [x1,y1,x2,y2] which are 84 ; coordinates. 85 ; 86 ; @keyword VECTEUR 87 ; It is a structure composed by 2 elements containing the 2 fields U 88 ; and V of values of the zonal and meridian component of the vector of the fields 89 ; to draw. These fields can be an array or a structure. 90 ; For example: vecteur={matriceu:lec('unsurface'),matricev:lec('vnsurface')} 91 ; Comment: name of elements of vectors are inconsenquential. 92 ; vecteur={u:lec('unsurface'),v:lec('vnsurface')} is also appropriated. 93 ; 94 ; @keyword DIREC 95 ; 't' 'x' 'y' 'z' 'xys' 'xz' 'yz' 'xyz' 'xt' 'yt' 'zt' 'xyt' 96 ; 'xzt' 'yzt' 'xyzt' Direction on which do averages 97 ; 98 ; @keyword _EXTRA 99 ; Used to pass your keywords. 100 ; 101 ; @keyword COLOR_C 102 ; To draw the contour in color instead of in black 103 ; with filling in color 104 ; 105 ; @param POSFENETRE {out} 106 ; It is a vector composed by 4 elements containing the position of the frame 107 ; containing captions and the graph in normalized coorinates. 108 ; Comment: To position the drawing; we have to do !p.position=posfenetre 109 ; after the call of the caliber 110 ; 111 ; @param POSBAR {out} 112 ; Like POSFENETRE but for the color bar. 113 ; Same comment to position the color bar, !p.position=posbar 114 ; 115 ; @uses 116 ; common.pro 117 ; 118 ; @history 119 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 43 120 ; 26/4/1999 121 ; 122 ; @version 123 ; $Id$ 124 ; 44 125 ;- 45 126 ;------------------------------------------------------------ … … 65 146 ENDIF 66 147 ;------------------------------------------------------------- 67 ; 1) determination de la taille des marges (unite=nbre de lignes ou colonnes)68 ; a gauche, a droite, en bas, en haut69 ; ATTENTION ds margebar le dernier element est le coint en haut a droite au70 ; lieu de la marge en haut148 ; 1) Determination of the size of margins (unity=number of lines or columns) 149 ; to the left, to the right, up and down. 150 ; BEWARE in margebar, the last element is the right up corner 151 ; instead of the up margin 71 152 ;------------------------------------------------------------- 72 153 if n_elements(typedessin) EQ 0 then typedessin = 'autre' … … 103 184 ENDELSE 104 185 ;-------------------------------------------------------------- 105 ; portrair oulandscape186 ; Portrait or landscape 106 187 ;-------------------------------------------------------------- 107 188 IF NOT keyword_set(noerase) THEN BEGIN … … 113 194 ENDIF 114 195 ;-------------------------------------------------------------- 115 ; Quel type de rapport d''aspect (sera ecrase si YXASPECT existe)196 ; What type of aspect rapport (it will be crushed if YXASPECT exist) 116 197 ;-------------------------------------------------------------- 117 198 case typedessin of … … 122 203 endcase 123 204 ;------------------------------------------------------------- 124 ; 2) calcul de!p.position125 ; cfcalibre.pro.205 ; 2) calculation of !p.position 206 ; see calibre.pro. 126 207 ;------------------------------------------------------------ 127 208 ; … … 134 215 !p.position = posfenetre 135 216 ;------------------------------------------------------------ 136 ; 3) o uverture de la fenetre graphique ou dupostscript217 ; 3) opening of the graphic window or of the postscript 137 218 ;------------------------------------------------------------ 138 219 case 1 of 139 ; cas du premier dessin sur unpostcript220 ; case of the first drawing on a postcript 140 221 keyword_set(post) AND !d.name ne 'PS':openps, _extra = ex 141 ; cas du premier dessin sur un ecran222 ; case of the first drawing on a screen 142 223 keyword_set(post) EQ 0 AND keyword_set(noerase) EQ 0 $ 143 224 AND !d.name ne 'PS' AND !d.name ne 'Z':BEGIN 144 225 if not keyword_set(window) then window = 0 145 ; pour l''utilisation de @ps, @oups et de@vzoom146 if lmgr(/demo) EQ 0 then BEGIN ; on est en mode demo??147 if !journal NE 0 then journal ; on ferme le journal s''il est ouvert226 ; For the using of \@ps,\@oups et de \@vzoom 227 if lmgr(/demo) EQ 0 then BEGIN ; Are we in the demo mode?? 228 if !journal NE 0 then journal ; We close te journal if it is open 148 229 homedir = isadirectory(io = homedir, title = 'Bad definition of homedir') 149 230 def_myuniquetmpdir 150 journal, myuniquetmpdir+'idlsave.pro' ; on en ouvre un nouveau151 help, /recall_commands, output = listecommande ; on recupere la derniere commande231 journal, myuniquetmpdir+'idlsave.pro' ; We open a new one 232 help, /recall_commands, output = listecommande ; We recuperate the last command 152 233 listecommande = strmid(strcompress(listecommande[1]), 2) 153 journal, listecommande ; on l''ecrit dans le journal234 journal, listecommande ; We write it in the journal 154 235 ENDIF 155 236 windsize = givewindowsize() 156 237 window, window, xsize = windsize[0], ysize = windsize[1], retain = 2, _extra = ex 157 ; qd on utilise des couleurs codees sur 24 bit, je n''arrive pas a stipuler la couleur du158 ; fond d''une fenetre a l'aide de !p.background, je suis oblige de faire cette bidouille!!!238 ; When we used colors which are coded on 24bit, we can not stipulate the background color 239 ; of a window thanks to !p.background, so we have to to this: 159 240 ; if !d.n_colors gt 256 then begin 160 241 ; device, decomposed=1
Note: See TracChangeset
for help on using the changeset viewer.