source: trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltt.pro @ 326

Last change on this file since 326 was 326, checked in by smasson, 17 years ago

bugfix with max values of strictfill keyword

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 28.4 KB
Line 
1;+
2;
3; @file_comments
4; Trace hovmoeller graphs: xt,yt,zt,t
5;
6; @categories
7; Graphics
8;
9; @param TAB {in}{required}
10; The field whose we want to make the hovmoeller map can be 2 kind of thing:
11;       1) An array which can be:
12;          * 3d or 4d: array  'xt','yt','zt','t'. The last component is the time. In this case, the array will
13;            pass in <pro>grossemoyenne</pro> to be averaged and become an 1d or 2d array.
14;          * 2d: If the array is already 2d, it is not modified (beware, lands must
15;            be masked at the value valmask) and nevertheless, type must be specified
16;            to we know of which trace it is about.
17;            To have a correct caption, respecify the extraction zone via BOXZOOM.
18;          * 1d: only for traces of the 't' type. Nevertheless, type must be specified
19;            to we know of which trace it is about.
20;            To have a correct caption, respecify the  extraction zone via BOXZOOM.
21;       2) a structure respecting all criterions specified by <pro>litchamp</pro>
22;          See IDL> xhelp,'litchamp'. The array contained in the structure
23;          respecting criterions of case 1)
24;
25;
26; @param GIVENTYPE
27;
28; @param GIVENMIN
29; valeur minimum que l''on veut prendre en compte dans le trace
30; des contours. Par defaut on prend le min de tableau (sur les pts mer)
31;
32; @param GIVENMAX
33; valeur maximum que l''on veut prendre en compte dans le trace
34; des contours. Par defaut on prend le max de tableau (sur les pts mer)
35;
36; @param DATMIN
37; c''est la borne inf de l''axe temporel. c''est un
38;       longinteger de la forme yyyymmdd (ou bien yymmdd).
39;
40; @param DATMAX
41; c''est la borne max de l''axe temporel. c''est un
42;       longinteger de la forme yyyymmdd (ou bien yymmdd)
43;
44; @keyword BOXZOOM
45; Vector indicating the geographic zone (3d) on which the extraction of the field must
46; be done to do the hovmoeller.
47;  If BOXZOOM has :
48; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]]
49; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]]
50; 4 elements: The extraction is made on [Boxzoom, vert1, vert2]
51; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]]
52; 6 elements: The extraction is made on Boxzoom
53;
54; Where lon1, lon2,lat1,lat2,vert1,vert2 are global variables defined at the last
55; <pro>domdef</pro> !
56;
57; @keyword CONTINTERVALLE
58; When CONTOUR is activated, it is the value between 2 isolines
59; traced by a trait. So it can be different from the one specified by INTERVALLE which,
60; in this case, does not control colored isolines in color anymore. If there is noone
61; specified min, we choose a contour min which goes well with the specified interval!
62; If this keyword is not specified, we trace 20 isolines from the min to the max.
63;
64; @keyword CONTLABEL {type=integer}
65; When CONTOUR is activated, if n
66; is different of 0, choose the label type corresponding to n cases for
67; the traced by a traitisolines. To specify the type of label of the
68; colored contour, use LABEL
69;
70; @keyword CONTMAX {default=we take the max of the array passed in the keyword CONTOUR (on ocean points)}
71; When CONTOUR is activated, max value we want to consider in the isoline
72; traced by a trait's line.
73;
74; @keyword CONTMIN {default=we take the min of the array passed in the keyword CONTOUR (on ocean points)}
75; When CONTOUR is activated, min value we want to consider in the isoline
76; traced by a trait's line.
77;
78; @keyword CONTNLEVEL {default=20}
79; When  CONTOUR is activated, it is the number of contours
80; traced by a trait for drawing (active if
81; CONTLABEL=0).
82;
83; @keyword CONTOUR
84; If we want to trace contours of a different field than the one
85; whose we have the colored drawing (by example E-P in color and QSR in contours).
86; It must be a field respecting same characteristics than the argument number one of pltt.
87;
88; @keyword ENDPOINTS
89; keyword specifying that we want to make a vertical cut in diagonal. Then coordinated of extremities
90; of these one are defined by the 4 elements of the vector ENDPOINTS: [x1,y1,x2,y2] which are
91; coordinates.
92;
93; @keyword EXCHANGE_XY
94; Allows to invert axes.
95;
96; @keyword FILTER
97; Apply a slippery average of width FILTER
98;
99; @keyword INTERVALLE
100; Value of an interval between two isolines. If there is none specified min,
101; we choose a min contour which goes well with the specified interval!. If this keyword is not
102; specified, we trace 20 isoline from the min to the max. Comment: When CONTOUR is activated,
103; INTERVALLE only specify the interval between 2 colored isolines. To specify the interval
104; between 2 isolines traced by a trait, use CONTINTERVALLE.
105;
106; @keyword INV
107; Invert the color vector used to color the graph
108;               (without use the black, the white and the used palette)
109;
110; @keyword LABEL {type=integer}
111; If n different of 0, it choose the label's type
112; corresponding to cases n. cf <pro>label</pro>
113; Comment: When CONTOUR is activated, it only specify the label's type for colored isolines.
114; For these one traced by a trait, use CONTLABEL.
115;
116; @keyword COL1d
117; --OBSOLETE--Color number when we make a trace 1d by default, 0.It is better to use the
118; keyword COLOR used by plot.
119;
120; @keyword MAXIN
121; to specify the max value we want to plot with a keyword instead of with the
122; input parameter max. If max is defined by both, parameter and keyword, the
123; keyword is retained.
124;
125; @keyword MININ
126; to specify the min value we want to plot with a keyword instead of with the
127; input parameter min. If min is defined by both, parameter and keyword, the
128; keyword is retained.
129;
130; @keyword NLEVEL {default=20}
131; Number of contours to draw. active if
132; LABEL=0 or is not specified.
133;
134; @keyword NOFILL
135; To make just isolines with no filling
136;
137; @keyword CONTNLEVEL {default=20}
138; When CONTOUR is activated, it is the number of contours
139; traced by a trait for drawing (active if
140; CONTLABEL=0).
141;
142; @keyword OV1D
143; Allows to overprint a 1d curve over a precedent 1d drawing.
144;
145; @keyword OVERPLOT
146; To make a plot over an other one.
147; Comment: Contrarily to the use of CONTOUR or VECTEUR, the use of this keyword
148; does not the caption and/or the color bar.
149;
150; @keyword STRICTFILL
151; Activate this keyword to that the filling of contours be
152; precisely done between the min and the max specified. Values inferior/superior at the
153; specified min/max are not filled. Note that max values a considered
154; as missing values so cells containing one or more corners with
155; values above max will have no contours drawn through them. 
156;
157; @keyword STYLE {default=style=0}
158; Contour's style to adopt to draw isolines. See <pro>style</pro> for more informations
159;
160; @keyword STY1D
161; --OBSOLETE--
162; Number of the style used when we make a 1d drawing. We should better use the
163; keyword LINESTYLE which is tho one of the plot. Beware, this keyword is still
164; useful if we want to d bars instead of curves, put sty1d='bar'
165;
166; @keyword TREND_TYPE
167; Modify field by calling <pro>trends</pro>
168;
169; @keyword TYPEIN
170; allows to specify the type of hovmoeller we want to do
171;             'xt','yt','zt','t'
172; with help of a keyword rather than the argument type. If the argument and the
173; keyword are specified in the same time, it is the value specified by the
174; keyword which is retained.
175;
176; @keyword _EXTRA
177; Used to pass keywords
178;
179; @uses
180; common.pro
181;
182; @history
183; Sebastien Masson (smasson\@lodyc.jussieu.fr)
184;                       27/5/98
185;                       Jerome Vialard (adapting plt to hovmoeller drawing)
186;                       2/7/98
187;                       Sebastien Masson 14/8/98 (continents,barres)
188;                       15/1/98
189; Adaptation for arrays 3 and 4d to the average be done in pltt rather than during the reading.
190;                       Sebastien Masson 14/8/98
191;                       7/1999
192;                       Eric Guilyardi 29/7/99 FILTER, TREND_TYPE,
193;                       REPEAT_C
194;                       Sebastien Masson 08/02/2000 checkfield and
195;                       usetri keyword.
196;
197; @version
198; $Id$
199;
200; @todo
201; seb: definition of parameters, L.426 à 427, L. 492 à 493
202;
203;-
204PRO pltt, tab, giventype, givenmin, givenmax, datmin, datmax, BOXZOOM = boxzoom, CONTOUR = contour $
205          , ENDPOINTS = endpoints, INTERVALLE = intervalle, INV = inv  $
206          , CONTINTERVALLE = contintervalle, LABEL = label, CONTLABEL = contlabel $
207          , STYLE = style, CONTMAX = contmax, CONTMIN = contmin $
208          , NOFILL = nofill, NLEVEL = nlevel, CONTNLEVEL = contnlevel $
209          , COL1D = col1d, STY1D = sty1d, MININ = minin, MAXIN = maxin $
210          , OV1D = ov1d, FILTER = filter, TREND_TYPE = trend_type $
211          , REPEAT_C = repeat_c, TYPEIN = typein, XT = XT, YT = YT, ZT = zt $
212          , TT = tt, STRICTFILL = strictfill, OVERPLOT = overplot $
213          , EXCHANGE_XY = exchange_xy $
214          , _EXTRA = ex
215;
216  compile_opt idl2, strictarrsubs
217;
218@cm_4mesh
219@cm_4data
220@cm_4cal
221  IF NOT keyword_set(key_forgetold) THEN BEGIN
222@updatenew
223@updatekwd
224  ENDIF
225;--------------------------------------------------------------
226;------------------------------------------------------------
227   tempsun = systime(1)         ; For key_performance
228;--------------------------------------------------------------
229; I2) reinitialization. !p.,!x.,!y.
230; Comment: we do not reinitialize when we call back plt in loop to use contour.
231;--------------------------------------------------------------
232   if n_elements(contour) ne 4 AND NOT keyword_set(overplot) $
233    AND NOT keyword_set(ov1d) then reinitplt
234;--------------------------------------------------------------
235; I1) Reading of the field.
236;--------------------------------------------------------------
237   if (keyword_set(boxzoom) OR keyword_set(endpoints)) $
238     AND n_elements(contour) ne 4 THEN BEGIN
239     savedbox = 1b
240     saveboxparam, 'boxparam4pltt.dat'
241   ENDIF
242   if n_elements(giventype) NE 0 then type = giventype
243   if n_elements(givenmin) NE 0 then min = givenmin
244   if n_elements(givenmax) NE 0 then max = givenmax
245   if n_elements(minin) NE 0 then min = minin
246   if n_elements(maxin) NE 0 then max = maxin
247   if keyword_set(typein) then BEGIN
248      if size(type, /type) NE 7 AND size(type, /type) NE 0 then begin
249         if n_elements(min) NE 0 then max = min
250         min = type
251      endif
252      type = typein
253    ENDIF
254;
255   checktypeminmax, 'pltt', TYPE = type, MIN = min, MAX = max $
256     , XT = XT, YT = YT, ZT = zt, TT = tt, ENDPOINTS = endpoints, _extra = ex
257;
258   if keyword_set(endpoints) then begin
259      section, tab, z2d, glam, gphi, ENDPOINTS = endpoints, TYPE = type $
260        , BOXZOOM = boxzoom, DIREC = direc
261      nx = n_elements(glam)
262      ny = nx
263      if strupcase(vargrid) EQ 'W' then begin
264         z = gdepw[firstzw:lastzw]
265         nz = nzw
266      ENDIF ELSE BEGIN
267         z = gdept[firstzt:lastzt]
268         nz = nzt
269      ENDELSE
270   ENDIF ELSE BEGIN
271      z2d = checkfield(tab, 'pltt', TYPE = type, BOXZOOM = boxzoom $
272                       , direc = direc, _extra = ex)
273      if n_elements(z2d) EQ 1 AND z2d[0] EQ -1 then BEGIN
274        IF keyword_set(savedbox) THEN restoreboxparam, 'boxparam4pltt.dat'
275        return
276      endif
277      grille, mask, glam, gphi, gdep, nx, ny, nz, type = type
278   ENDELSE
279;---------------------------------------------------------------
280; Calculation of trend/anomaly following TREND_TYPE
281;---------------------------------------------------------------
282
283   IF NOT keyword_set(trend_type) THEN trend_type = 0
284
285   IF trend_type GT 0 THEN z2d = trends(z2d, trend_type, type)
286
287;---------------------------------------------------------------
288; Filtering of fields in the 't' case.
289;---------------------------------------------------------------
290
291   IF type EQ 't' AND keyword_set(filter) THEN BEGIN
292      ras = report('    Applying a running mean filter of width '+string(filter, format = '(I3)'))
293      z2d = smooth(z2d, filter)
294      z2d[0:filter/2-1] = 0.
295      z2d[(size(z2d))[1]-filter/2-1:(size(z2d))[1]-1] = 0.
296   ENDIF
297
298;---------------------------------------------------------------
299; Repetition of the temporal series
300;---------------------------------------------------------------
301
302   IF NOT keyword_set(repeat_c) THEN repeat_c = 1
303
304   temps = time[0:jpt-1]
305   IF repeat_c GT 1 THEN BEGIN
306      taille=size(z2d)
307      CASE taille[0] OF
308         1: z2d = reform(z2d#replicate(1, repeat_c), taille[1]*repeat_c)
309         2: BEGIN
310            z2d = z2d[*]#replicate(1, repeat_c)
311            z2d = reform(z2d, taille[1], taille[2]*repeat_c, /over)
312         END
313         ELSE:
314      ENDCASE
315      temps = [temps, (lindgen(jpt*(REPEAT_c-1))+1)*(temps[1]-temps[0])+temps[jpt-1]]
316   ENDIF
317
318;---------------------------------------------------------------
319; Selection of graphic's type.
320;---------------------------------------------------------------
321   taille=size(z2d)
322   case taille[0] of
323      2 : typdes='2d'
324      1 : begin
325         z1d=z2d
326         typdes='1d'
327         if keyword_set(OV1D) then begin
328            yy = z2d
329            if n_elements(datmin) NE 0 then tempsmin = date2jul(datmin) $
330            ELSE tempsmin = temps[0]
331; on shift l''axe du temps pour des questions de precision sur les
332; dates du calendier julien en long qui sont passes en float ds les axes
333            xx = temps-tempsmin
334            !x.range=!x.range-tempsmin
335            !x.tickv=!x.tickv-tempsmin
336; We do a false plot to apply these changes!
337            plot,[0], [0],/noerase,xstyle=5, ystyle = 5, title = '', subtitle = '', ytitle = '', xtitle = ''
338            goto, trace1d
339         endif
340      end
341  endcase
342; We build the mask. For that, the table must be masked (automatically done at the
343; value valmask if we pass in moyenne or grossemoyenne)
344   nan = total(finite(z2d,/nan)) < 1
345   if n_elements(valmask) EQ 0 then valmask = 1e20
346   if keyword_set(nan) then begin
347      notanum = where(finite(z2d) EQ 0)
348      z2d[notanum] = 0.
349      mask = z2d LT valmask/10.
350      z2d[notanum] = !values.f_nan
351   ENDIF ELSE mask = z2d LT valmask/10.
352;----------------------------------------------------------------------------
353;   determination du mi:min et du ma:max de z2d ainsi que de max: max et
354;    min: min pour le dessin.
355;-----------------------------------------------------------------------------
356; Do we need to do an autoscale ???
357   autoscale = testvar(var = min) EQ testvar(var = max) AND NOT keyword_set(intervalle)
358   determineminmax, z2d, mask, mi, ma, MININ = min, MAXIN = max, nan = nan, INTERVALLE = intervalle, _extra = ex
359   if n_elements(z2d) EQ 1 AND z2d[0] EQ -1 THEN return
360; We do an autoscale if needed.
361   if autoscale then autoscale, min, max, intervalle
362;-----------------------------------------------------------------------------
363;-----------------------------------------------------------------------------
364   if n_elements(contour) ne 4  AND NOT keyword_set(overplot) THEN $
365    placedessin, 'pltt',posfenetre, posbar, contour = contour, direc = direc, type = type, endpoints = endpoints, _extra = ex
366;--------------------------------------------------------------
367;--------------------------------------------------------------
368; 2nd part: drawing
369;--------------------------------------------------------------
370;-----------------------------------------------------------
371;   definition of axis
372;----------------------------------------------------------
373;-----------------------------------------------------------------------------
374; definition of the abscisse and ordinate vectors.
375; The triangulation is defined in order to the drawing be done from the
376; left bottom to the right up. So the matrix have to be shown like this,
377; from which some transpose and reverse
378;-----------------------------------------------------------------------------
379;-----------------------------------------------------------------------------
380; definition of limits of the temporal axis
381;-----------------------------------------------------------------------------
382   case N_PARAMS() OF
383      5 : begin
384         tempsmin = date2jul(datmin)
385         tempsmax = temps[(jpt*repeat_c)-1]
386      end
387      6 : begin
388         tempsmin = date2jul(datmin)
389         tempsmax = date2jul(datmax)
390      end
391      else : begin
392         tempsmin = temps[0]
393         tempsmax = temps[(jpt*repeat_c)-1]
394      end
395   endcase
396;-----------------------------------------------------------------------------
397; on shift l''axe du temps pour des questions de precision sur les
398; dates du calendier julien en long qui sont passes en float ds les axes
399   case typdes of
400      '1d' : begin
401         yy = z1d
402         xx = temps-tempsmin
403      end
404      '2d' : begin
405         case 1 of
406            type eq 'xt' : BEGIN
407               xx = glam[*, 0]
408               yy = temps-tempsmin
409            end
410            type eq 'yt' : begin
411               IF (size(gphi))[0] EQ 1 then yy = gphi ELSE BEGIN
412                 IF keyword_set(key_irregular) THEN BEGIN
413                   cln = (where(gphi EQ max(gphi)))[0]
414                   yy = reform(gphi[cln MOD nx, *])
415                 ENDIF ELSE yy = reform(gphi[0, *])
416               ENDELSE
417               xx = temps-tempsmin
418               z2d = transpose(z2d)
419               mask = transpose(mask)
420            end
421            type eq 'zt' : begin
422               IF size(gdep, /n_dimensions) EQ 2 THEN $
423                  yy = transpose(gdep) ELSE yy = gdep
424               xx = temps-tempsmin
425               z2d = transpose(z2d)
426               mask = transpose(mask)
427            end
428         endcase
429      end
430   endcase
431;--------------------------------------------------------------
432   if NOT keyword_set(overplot) THEN axe, type, tempsmin, tempsmax, _EXTRA = ex ELSE BEGIN
433      if type EQ 'xt' then BEGIN
434         !y.range=!y.range-tempsmin
435         !y.tickv=!y.tickv-tempsmin
436      ENDIF ELSE BEGIN
437         !x.range=!x.range-tempsmin
438         !x.tickv=!x.tickv-tempsmin
439      ENDELSE
440   ENDELSE
441;------------------------------------------------------------
442;------------------------------------------------------------
443; drawing
444;------------------------------------------------------------
445; 2d
446;------------------------------------------------------------
447   if (typdes eq '2d') then begin
448;--------------------------------------------------------------
449; choice of labels
450;-----------------------------------------------------------
451      if keyword_set(intervalle) AND NOT keyword_set(label) then label=1
452      if keyword_set(label) eq 0 then cas=0 else cas=label
453      label, cas, min, max, ncontour, level_z2d, colnumb, NLEVEL = nlevel $
454             , INTERVALLE = intervalle, strictfill = strictfill
455;--------------------------------------------------------------
456; choice of style
457;-----------------------------------------------------------
458      if not keyword_set(style) then style=0
459      style,style,level_z2d,linestyle,thick
460      if keyword_set(inv) then colnumb=reverse(colnumb)
461;----------------------------------------------------------------------
462      nby = n_elements(yy)
463      nbx = n_elements(xx)
464;
465      if keyword_set(nan) then BEGIN
466;         xx = xx#replicate(1, nby) ; We make a 2d array with axes
467;         yy = replicate(1, nbx)#yy
468         masknan = finite(z2d)
469         IF NOT keyword_set(nofill) THEN z2d[where(masknan EQ 0)] = max
470         mask = temporary(mask)*temporary(masknan)
471       ENDIF
472      usetri = 0 ; default definition
473      IF keyword_set(strictfill) THEN BEGIN
474        tmp = z2d ge max
475        tmp = 1b - byte(extrapolate(tmp, tmp, 1))
476        key_save = key_periodic & key_periodic = 0
477        trifield = triangule(temporary(tmp)*mask, coinmonte = coinmontemaskaa $
478                             , coindescend = coindescendmaskaa, keep_cont = 0)
479        key_periodic = key_save
480        usetri = 2
481      ENDIF
482      z2d = remplit(z2d,nite=2+keyword_set(nan), mask = mask, /basique, _extra=ex)
483      if NOT keyword_set(strictfill) then z2d = min > z2d <  max
484      if keyword_set(nan) then BEGIN
485        triangulation = triangule(mask, /basic, coinmonte = coinmontemask $
486                                  , coindescend = coindescendmask)
487        usetri = 1
488      ENDIF ELSE triangulation = -1
489      IF size(gdep, /n_dimensions) EQ 2 THEN BEGIN
490        usetri = 2
491        IF triangulation[0] EQ -1 THEN $
492           triangulation = triangule(mask, /basic, coinmonte = coinmontemask $
493                                     , coindescend = coindescendmask)
494      ENDIF
495      IF NOT keyword_set(strictfill) THEN trifield = triangulation
496;----------------------------------------------------------------------
497      pltbase, z2d, xx, yy, mask, xx, yy, level_z2d, colnumb, contour = contour, /noerase $
498       , c_linestyle=linestyle,c_labels=1-(indgen(n_elements(level_z2d)) MOD 2) $
499       , trichamp = trifield, trimsk = triangulation, overplot = overplot $
500       , c_thick=thick, performance = key_performance, nofill = nofill, usetri = usetri $
501       , coinmontemask=coinmontemask, coindescendmask=coindescendmask, _extra = ex
502;------------------------------------------------------------
503      if n_elements(contour) eq 4 then BEGIN ; it is the second time I pass in pltt
504         contour = {mietma:[mi, ma], unit:varunit, inter:intervalle} ; I send back the min, the max and the unity
505         return
506      endif
507;------------------------------------------------------------
508      if keyword_set(contour) then BEGIN
509         pourlegende = [1, 1, 1, 1]
510         oldattributs = saveatt()
511         oldcolnumb = colnumb
512         pltt,contour,type, contmin,contmax,CONTOUR=pourlegende, /noerase, USETRI = usetri $
513          ,INTERVALLE=contintervalle,LABEL=contlabel,STYLE=style, ENDPOINTS = endpoints $
514           , NLEVEL = contnlevel, BOXZOOM = boxzoom, STRICTFILL = strictfill, _extra = ex
515         colnumb = oldcolnumb
516         restoreatt, oldattributs
517      endif
518;----------------------------------------------------------------------
519;----------------------------------------------------------------------
520      if keyword_set(overplot) then GOTO, fini
521;------------------------------------------------------------
522; Trace the line of change of date and the equator.
523;------------------------------------------------------------
524      IF key_onearth THEN BEGIN
525        CASE type OF
526          'xt':oplot, [180, 180] - 360*(!x.range[1] LT 180), !y.range
527          'yt':oplot, !x.range, [0, 0]
528          ELSE:
529        ENDCASE
530      ENDIF
531;------------------------------------------------------------
532;  caption + display of these.
533;------------------------------------------------------------
534      legende,mi,ma,type, CONTOUR = pourlegende, DIREC = direc, INTERVALLE = intervalle $
535       , ENDPOINTS = endpoints, _extra = ex
536;
537; we want to draw the time axis with tick length = 1. if we simply
538; use [xy]style=1 then each axis (up and down or left and right) have
539; majorticks with a length of 1 (-> not very nice when xgridstyle=2),
540; same if xticklen=0.5 (not very nice in the middle). => so we draw
541; the top (right) axis by hand using axis.
542;
543      if n_elements(ex) NE 0 then BEGIN
544; pour avoir un cadre de la couleur noire
545        if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0
546      ENDIF
547;
548      plot, [0], [0], /nodata, /noerase, _extra = ex $
549        , xstyle = 1+4*(keyword_set(endpoints) AND type EQ 'xt' AND lat1 NE lat2)+8*(type EQ 'yt' OR type EQ 'zt') $
550        , ystyle = 1+4*(keyword_set(endpoints) AND type EQ 'yt')+8*(type EQ 'xt')
551; call axis for the missing axis.
552      IF type EQ 'xt' AND NOT keyword_set(endpoints) THEN BEGIN
553        if n_elements(ex) NE 0 then $
554          if (where(tag_names(ex) EQ 'YTICKNAME'))[0] NE -1 then $
555          ex.YTICKNAME = replicate(' ', n_elements(ex.YTICKNAME))
556        axis, yaxis = 1, ystyle = 1, yticklen = 0 $
557          , ytickname = replicate(' ', !y.ticks+1), _extra = ex
558      ENDIF
559      IF (type EQ 'yt' OR type EQ 'zt') AND NOT keyword_set(endpoints) THEN BEGIN
560        if n_elements(ex) NE 0 then $
561          if (where(tag_names(ex) EQ 'XTICKNAME'))[0] NE -1 then $
562          ex.XTICKNAME = replicate(' ', n_elements(ex.XTICKNAME))
563       axis, xaxis = 1, xstyle = 1, xticklen = 0 $
564        , xtickname = replicate(' ', !x.ticks+1), _extra = ex
565      ENDIF
566; ajout d'un axe ds le cas ou l'on utilise endpoints
567      if keyword_set(endpoints) then addaxe, endpoints, type, posfenetre, _EXTRA = ex
568;------------------------------------------------------------
569; color bar
570;------------------------------------------------------------
571      colnumb = colnumb[0:ncontour-1-keyword_set(strictfill)]
572      barrecouleur, colnumb, min,  max, (ncontour-keyword_set(strictfill))/2 $
573                    , position = posbar, _extra = ex
574;------------------------------------------------------------
575   endif
576;------------------------------------------------------------
577; 1d
578;------------------------------------------------------------
579trace1d:
580   if (typdes eq '1d') then begin
581      if (not keyword_set(col1d)) then col1d = 0
582      if keyword_set(sty1d) then BEGIN ;if we want to make bars
583         IF strlowcase(strtrim(sty1d)) EQ 'bar' then begin
584            !y.range = [!y.range[0]-(!y.range[1]-!y.range[0])*.05,!y.range[1]]
585            bar_plot, yy, background = (!d.n_colors-1) < 255,  $
586             baselines = replicate(!y.range[0], n_elements(yy)), barnames = ['', ''], $
587             colors    = replicate(col1d, n_elements(yy)), /outline
588            if n_elements(ex) NE 0 then BEGIN
589; To have a black frame
590              if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0
591            ENDIF
592            plot, [0], [0], /nodata, /noerase, _extra = ex
593            GOTO, fini
594         ENDIF
595      ENDIF
596      if NOT keyword_set(ov1d) then BEGIN
597         !y.range=[min-abs(max-min)/50.,max+abs(max-min)/50.]
598         legende,mi,ma,type, DIREC = direc, _extra = ex
599;
600         if keyword_set(exchange_xy) then begin
601            rien = !x
602            !x = !y
603            !y = rien
604            rien = xx
605            xx = yy
606            yy = rien
607         endif
608         plot, xx, yy, color = col1d, linestyle = sty1d, thick = 2 $
609           , title = '', subtitle = '', _extra = ex
610; draw 0 line
611         if keyword_set(exchange_xy) then $
612           oplot, [0, 0], !y.range ELSE oplot, !x.range, [0, 0]
613; we want to draw the axis with the time axis length = 1. if we simply
614; use xstyle=1 then each axis (up and down) have majorticks with a
615; length of 1 (-> not very nice when xgridstyle=2), same if
616; xticklen=0.5 (not very nice in the middle).
617; => so we draw the top axis by hand using axis.
618         if n_elements(ex) NE 0 then BEGIN
619; To have a black frame
620            if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0
621         ENDIF
622         plot, [0], [0], /nodata, /noerase $
623           , xstyle = 1+8*(1-keyword_set(exchange_xy)) $
624           , ystyle = 1+8*keyword_set(exchange_xy), _extra = ex
625; call axis for the missing axis.
626         if n_elements(ex) NE 0 then BEGIN
627; force tickname to blank array
628            if (where(tag_names(ex) EQ 'YTICKNAME'))[0] NE -1 AND keyword_set(exchange_xy) then ex.YTICKNAME = replicate(' ', n_elements(ex.YTICKNAME))
629            if (where(tag_names(ex) EQ 'XTICKNAME'))[0] NE -1 AND NOT keyword_set(exchange_xy) then ex.XTICKNAME = replicate(' ', n_elements(ex.XTICKNAME))
630         ENDIF
631         if keyword_set(exchange_xy) then  axis, yaxis = 1, ystyle = 1 $
632           , yticklen = 0, ytickname = replicate(' ', !y.ticks+1), _extra = ex $
633         ELSE axis, xaxis = 1, xstyle = 1, xticklen = 0 $
634           , xtickname = replicate(' ', !x.ticks+1), _extra = ex
635       ENDIF ELSE oplot, xx, yy, color = col1d, linestyle = sty1d, thick = 2, _extra = ex
636   endif
637fini:
638;------------------------------------------------------------
639; we reput time axis in IDL julian days and not in julian days count from tempsmin
640;------------------------------------------------------------
641   if type EQ 'xt' then BEGIN
642      !y.range=!y.range+tempsmin
643      !y.tickv=!y.tickv+tempsmin
644   ENDIF ELSE BEGIN
645      !x.range=!x.range+tempsmin
646      !x.tickv=!x.tickv+tempsmin
647   ENDELSE
648; We do a false plot to these values are considerated
649   plot, [0], [0], /nodata, /noerase, xstyle = 5, ystyle = 5 $
650     , title = '', subtitle = '', ytitle = '', xtitle = ''
651;------------------------------------------------------------
652;------------------------------------------------------------
653; 3rd part: possible print
654;------------------------------------------------------------
655;------------------------------------------------------------
656   terminedessin, _extra = ex
657   if keyword_set(savedbox) THEN restoreboxparam, 'boxparam4pltt.dat'
658;------------------------------------------------------------
659   if n_elements(key_performance) NE 0 then $
660    IF key_performance EQ 1 THEN print, 'temps pltt', systime(1)-tempsun
661;------------------------------------------------------------
662;------------------------------------------------------------
663;------------------------------------------------------------
664   return
665end
Note: See TracBrowser for help on using the repository browser.