;+
;
; @file_comments
; Trace hovmoller graphs: xt,yt,zt,t
;
; @categories Graphics
;
; @param TAB {in}{required}
; The field whose we want to make the hovmoller map can be 2 kind of thing:
; 1) An array which can be:
; * 3d or 4d: array 'xt','yt','zt','t'. The last component is the time. In this case, the array will
; pass in grossemoyenne to be averaged and become an 1d or 2d array.
; * 2d: If the array is already 2d, it is not modified (beware, lands must
; be masked at the value valmask) and nevertheless,type must be specified
; to we know of which trace it is about.
; To have a correct caption, respecify the extraction zone via BOXZOOM.
; * 1d: only for traces of the 't' type. Nevertheless, type must be specified
; to we know of which trace it is about.
; To have a correct caption, respecify the extraction zone via BOXZOOM.
; 2) a structure respecting all criterions specified by litchamp
; See IDL> xhelp,'litchamp'. The array contained in the structure
; respecting criterions of case 1)
;
; PARAM:
; MAX: valeur maximum que l''on veut prendre en compte dans le trace
; des contours. Par defaut on prend le max de tableau (sur les pts mer)
;
; MIN: valeur minimum que l''on veut prendre en compte dans le trace
; des contours. Par defaut on prend le min de tableau (sur les pts
; mer)
;
; DATMIN: c''est la borne inf de l''axe temporel. c''est un
; longinteger de la forme yyyymmdd (ou bien yymmdd).
;
; DATMAX: c''est la borne max de l''axe temporel. c''est un
; longinteger de la forme yyyymmdd (ou bien yymmdd)
;
; @keyword BOXZOOM
; Vector indicating the geographic zone (3d) on which the extraction of the field must
; be done to do the hovmoeller.
; If BOXZOOM has :
; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]]
; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]]
; 4 elements: The extraction is made on [Boxzoom, vert1, vert2]
; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]]
; 6 elements: The extraction is made on Boxzoom
;
; Where lon1, lon2,lat1,lat2,vert1,vert2 are global variables defined at the last domdef!
;
; @keyword CONTINTERVALLE
; When CONTOUR is activated, it is the value between 2 isolines
; traced by a trait. So it can be different from the one specified by INTERVALLE which,
; in this case, does not control colored isolines in color anymore. If there is noone
; specified min, we choose a contour min which goes well with the specified interval!
; If this keyword is not specified, we trace 20 isolines from the min to the max.
;
; @keyword CONTLABEL {type=integer}
; When CONTOUR is activated, if n
; is different of 0, choose the label type corresponding to n cases for
; the traced by a traitisolines. To specify the type of label of the
; colored contour, use LABEL
;
; @keyword CONTMAX {default=we take the max of the array passed in the keyword CONTOUR (on ocean points)}
; When CONTOUR is activated, max value we want to consider in the isoline
; traced by a trait's line.
;
; @keyword CONTMIN {default=we take the min of the array passed in the keyword CONTOUR (on ocean points)}
; When CONTOUR is activated, min value we want to consider in the isoline
; traced by a trait's line.
;
; @keyword CONTNLEVEL {default=20}
; When CONTOUR is activated, it is the number of contours
; traced by a trait for drawing (active if
; CONTLABEL=0).
;
; @keyword CONTOUR
; If we want to trace contours of a different field than the one
; whose we have the colored drawing (by example E-P in color and QSR in contours).
; It must be a field respecting same characteristics than the argument number one of pltt.
;
; @keyword ENDPOINTS
; keyword specifying that we want to make a vertical cut in diagonal. Then coordinated of extremities
; of these one are defined by the 4 elements of the vector ENDPOINTS: [x1,y1,x2,y2] which are
; coordinates.
;
; @keyword EXCHANGE_XY
; Allows to invert axes.
;
; @keyword FILTER
; Apply a slippery average of width FILTER
;
; @keyword INTERVALLE
; Value of an internal between to isoline. If there is none specified min,
; we choose a min contour which goes well with the specified interval!. If this keyword is not
; specified, we trace 20 isoline from the min to the max. Comment: When CONTOUR is activated,
; INTERVALLE only specify the interval between 2 colored isoline. To specify the interval
; between 2 isolines traced by a trait, use CONTINTERVALLE.
;
; @keyword INV
; Invert the color vector used to color the graph
; (without use the black, the white and the used palette)
;
; @keyword LABEL {type=integer}
; If n different of 0, it choose the label's type
; corresponding to cases n. cf label
; Comment: When CONTOUR is activated, it only specify the label's type for colored isolines.
; For these one traced by a trait, use CONTLABEL.
;
; @keyword COL1d
; --OBSOLETE--Color number when we make a trace 1d by default, 0.It is better to use the
; keyword COLOR used by plot.
;
; @keyword MAXIN
; to specify the max value we want to plot with a keyword instead of with the
; input parameter max. If max is defined by both, parameter and keyword, the
; keyword is retained.
;
; @keyword MININ
; to specify the min value we want to plot with a keyword instead of with the
; input parameter min. If min is defined by both, parameter and keyword, the
; keyword is retained.
;
; @keyword NLEVEL {default=20}
; Number of contour to draw by default =20. active if
; LABEL=0 or is not specified.
;
; @keyword CONTNLEVEL {default=20}
; When CONTOUR is activated, it is the number of contours
; traced by a trait for drawing (active if
; CONTLABEL=0).
;
; @keyword OV1D
; Allows to overprint a 1d curve over a precedent 1d drawing.
;
; @keyword OVERPLOT
; To make a plot over an other one.
; Comment: Contrarily to the use of CONTOUR or VECTEUR, the use of this keyword
; does not the caption and/or the color bar.
;
; @keyword STRICTFILL
; Activate this keyword to that the filling of contours be
; precisely done between the min and the max specified letting values inferior at the
; specified min and values superior at the specified max in white.
;
; @keyword STYLE {default=style=0}
; Contour's style to adopt to draw isolines
;
; @keyword STY1D
; --OBSOLETE--
; Number of the style used when we make a 1d drawing. We should better use the
; keyword LINESTYLE which is tho one of the plot. Beware, this keyword is still
; useful if we want to d bars instead of curves, put sty1d='bar'
;
; @keyword TREND_TYPE
; Modify field by calling trends
;
; @keyword TYPEIN
; allows to specify the type of hovmoller we want to do
; 'xt','yt','zt','t'
; with help of a keyword rather than the argument type. If the argument and the
; keyword are specified in the same time, it is the value specified by the
; keyword which is retained.
;
; @keyword _EXTRA
; Used to pass keywords
;
; @uses
; common.pro
;
; @history
; Sebastien Masson (smasson\@lodyc.jussieu.fr)
; 27/5/98
; Jerome Vialard (adapting plt to hovmoller drawing)
; 2/7/98
; Sebastien Masson 14/8/98 (continents,barres)
; 15/1/98
; Adaptation for arrays 3 and 4d to the average be done in pltt rather than during the reading.
; Sebastien Masson 14/8/98
; 7/1999
; Eric Guilyardi 29/7/99 FILTER, TREND_TYPE,
; REPEAT_C
; Sebastien Masson 08/02/2000 checkfield and
; usetri keyword.
;
; @version
; $Id$
;
; @todo seb: L.24 à 36, L.426 à 427, L. 492 à 493
;-
;
PRO pltt,tab,giventype,givenmin,givenmax,datmin,datmax,BOXZOOM = boxzoom, CONTOUR=contour $
,ENDPOINTS=endpoints,INTERVALLE=intervalle,INV=inv $
,CONTINTERVALLE=contintervalle,LABEL=label,CONTLABEL=contlabel $
,STYLE=style, CONTMAX=contmax $
,CONTMIN=contmin,NLEVEL=nlevel,CONTNLEVEL=contnlevel $
,COL1D=col1d,STY1D=sty1d, MININ = minin, MAXIN = maxin $
,OV1D=ov1d, FILTER = filter, TREND_TYPE = trend_type $
,REPEAT_C = repeat_c, TYPEIN = typein, XT = XT, YT = YT, ZT = zt $
, TT = tt, STRICTFILL = strictfill, OVERPLOT = overplot $
, EXCHANGE_XY = exchange_xy $
, _EXTRA = ex
;
compile_opt idl2, strictarrsubs
;
@cm_4mesh
@cm_4data
@cm_4cal
IF NOT keyword_set(key_forgetold) THEN BEGIN
@updatenew
@updatekwd
ENDIF
;--------------------------------------------------------------
;------------------------------------------------------------
tempsun = systime(1) ; For key_performance
;--------------------------------------------------------------
; I2) reinitialization. !p.,!x.,!y.
; Comment: we do not reinitializate when we call back plt in loop to use contour.
;--------------------------------------------------------------
if n_elements(contour) ne 4 AND NOT keyword_set(overplot) $
AND NOT keyword_set(ov1d) then reinitplt
;--------------------------------------------------------------
; I1) Reading of the field.
;--------------------------------------------------------------
if (keyword_set(boxzoom) OR keyword_set(endpoints)) $
AND n_elements(contour) ne 4 THEN BEGIN
savedbox = 1b
saveboxparam, 'boxparam4pltt.dat'
ENDIF
if n_elements(giventype) NE 0 then type = giventype
if n_elements(givenmin) NE 0 then min = givenmin
if n_elements(givenmax) NE 0 then max = givenmax
if n_elements(minin) NE 0 then min = minin
if n_elements(maxin) NE 0 then max = maxin
if keyword_set(typein) then BEGIN
if size(type, /type) NE 7 AND size(type, /type) NE 0 then begin
if n_elements(min) NE 0 then max = min
min = type
endif
type = typein
ENDIF
;
checktypeminmax, 'pltt', TYPE = type, MIN = min, MAX = max $
, XT = XT, YT = YT, ZT = zt, TT = tt, ENDPOINTS = endpoints, _extra = ex
;
if keyword_set(endpoints) then begin
section, tab, z2d, glam, gphi, ENDPOINTS = endpoints, TYPE = type $
, BOXZOOM = boxzoom, DIREC = direc
nx = n_elements(glam)
ny = nx
if strupcase(vargrid) EQ 'W' then begin
z = gdepw[firstzw:lastzw]
nz = nzw
ENDIF ELSE BEGIN
z = gdept[firstzt:lastzt]
nz = nzt
ENDELSE
ENDIF ELSE BEGIN
z2d = checkfield(tab, 'pltt', TYPE = type, BOXZOOM = boxzoom $
, direc = direc, _extra = ex)
if z2d[0] EQ -1 then BEGIN
IF keyword_set(savedbox) THEN restoreboxparam, 'boxparam4pltt.dat'
return
endif
grille, mask, glam, gphi, gdep, nx, ny, nz, type = type
ENDELSE
;---------------------------------------------------------------
; Calculation of trend/anomaly following TREND_TYPE
;---------------------------------------------------------------
IF NOT keyword_set(trend_type) THEN trend_type = 0
IF trend_type GT 0 THEN z2d = trends(z2d, trend_type, type)
;---------------------------------------------------------------
; Filtering of fields in the 't' case.
;---------------------------------------------------------------
IF type EQ 't' AND keyword_set(filter) THEN BEGIN
print, ' Applying a running mean filter of width '+string(filter, format = '(I3)')
z2d = smooth(z2d, filter)
z2d[0:filter/2-1] = 0.
z2d[(size(z2d))[1]-filter/2-1:(size(z2d))[1]-1] = 0.
ENDIF
;---------------------------------------------------------------
; Repetition of the temporal series
;---------------------------------------------------------------
IF NOT keyword_set(repeat_c) THEN repeat_c = 1
temps = time[0:jpt-1]
IF repeat_c GT 1 THEN BEGIN
taille=size(z2d)
CASE taille[0] OF
1: z2d = reform(z2d#replicate(1, repeat_c), taille[1]*repeat_c)
2: BEGIN
z2d = z2d[*]#replicate(1, repeat_c)
z2d = reform(z2d, taille[1], taille[2]*repeat_c, /over)
END
ELSE:
ENDCASE
temps = [temps, (lindgen(jpt*(REPEAT_c-1))+1)*(temps[1]-temps[0])+temps[jpt-1]]
ENDIF
;---------------------------------------------------------------
; Selection of graphic's type.
;---------------------------------------------------------------
taille=size(z2d)
case taille[0] of
2 : typdes='2d'
1 : begin
z1d=z2d
typdes='1d'
if keyword_set(OV1D) then begin
yy = z2d
if n_elements(datmin) NE 0 then tempsmin = date2jul(datmin) $
ELSE tempsmin = temps[0]
; on shift l''axe du temps pour des questions de precision sur les
; dates du calendier julien en long qui sont passes en float ds les axes
xx = temps-tempsmin
!x.range=!x.range-tempsmin
!x.tickv=!x.tickv-tempsmin
; We do a false plot to apply these changes!
plot,[0], [0],/noerase,xstyle=5, ystyle = 5, title = '', subtitle = '', ytitle = '', xtitle = ''
goto, trace1d
endif
end
endcase
; We build the mask. For that, the table must be masked (automaticaly done at the
; value valmask if we pass in moyenne or grossemoyenne)
nan = total(finite(z2d,/nan)) < 1
if n_elements(valmask) EQ 0 then valmask = 1e20
if keyword_set(nan) then begin
notanum = where(finite(z2d) EQ 0)
z2d[notanum] = 0.
mask = z2d LT valmask/10.
z2d[notanum] = !values.f_nan
ENDIF ELSE mask = z2d LT valmask/10.
;----------------------------------------------------------------------------
; determination du mi:min et du ma:max de z2d ainsi que de max: max et
; min: min pour le dessin.
;-----------------------------------------------------------------------------
; Do we need to do an autoscale ???
autoscale = testvar(var = min) EQ testvar(var = max) AND NOT keyword_set(intervalle)
determineminmax, z2d, mask, mi, ma, MININ = min, MAXIN = max, nan = nan, INTERVALLE = intervalle, _extra = ex
if z2d[0] EQ -1 THEN return
; We do an autoscale if needed.
if autoscale then autoscale, min, max, intervalle
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
if n_elements(contour) ne 4 AND NOT keyword_set(overplot) THEN $
placedessin, 'pltt',posfenetre, posbar, contour = contour, direc = direc, type = type, endpoints = endpoints, _extra = ex
;--------------------------------------------------------------
;--------------------------------------------------------------
; 2nd part: drawing
;--------------------------------------------------------------
;-----------------------------------------------------------
; definition of axis
;----------------------------------------------------------
;-----------------------------------------------------------------------------
; definition of the abscisse and ordinate vectors.
; The triangulation is defined in order to the drawing be done from the
; left bottom to the right up. So the matrix have to be shown like this,
; from which some transpose and reverse
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
; definition of limits of the temporal axis
;-----------------------------------------------------------------------------
case N_PARAMS() OF
5 : begin
tempsmin = date2jul(datmin)
tempsmax = temps[(jpt*repeat_c)-1]
end
6 : begin
tempsmin = date2jul(datmin)
tempsmax = date2jul(datmax)
end
else : begin
tempsmin = temps[0]
tempsmax = temps[(jpt*repeat_c)-1]
end
endcase
;-----------------------------------------------------------------------------
; on shift l''axe du temps pour des questions de precision sur les
; dates du calendier julien en long qui sont passes en float ds les axes
case typdes of
'1d' : begin
yy = z1d
xx = temps-tempsmin
end
'2d' : begin
case 1 of
type eq 'xt' : BEGIN
xx = glam[*, 0]
yy = temps-tempsmin
end
type eq 'yt' : begin
IF (size(gphi))[0] EQ 1 then yy = gphi ELSE BEGIN
IF keyword_set(key_irregular) THEN BEGIN
cln = (where(gphi EQ max(gphi)))[0]
yy = reform(gphi[cln MOD nx, *])
ENDIF ELSE yy = reform(gphi[0, *])
ENDELSE
xx = temps-tempsmin
z2d = transpose(z2d)
mask = transpose(mask)
end
type eq 'zt' : begin
IF size(gdep, /n_dimensions) EQ 2 THEN $
yy = transpose(gdep) ELSE yy = gdep
xx = temps-tempsmin
z2d = transpose(z2d)
mask = transpose(mask)
end
endcase
end
endcase
;--------------------------------------------------------------
if NOT keyword_set(overplot) THEN axe, type, tempsmin, tempsmax, _EXTRA = ex ELSE BEGIN
if type EQ 'xt' then BEGIN
!y.range=!y.range-tempsmin
!y.tickv=!y.tickv-tempsmin
ENDIF ELSE BEGIN
!x.range=!x.range-tempsmin
!x.tickv=!x.tickv-tempsmin
ENDELSE
ENDELSE
;------------------------------------------------------------
;------------------------------------------------------------
; drawing
;------------------------------------------------------------
; 2d
;------------------------------------------------------------
if (typdes eq '2d') then begin
;--------------------------------------------------------------
; choice of labels
;-----------------------------------------------------------
if keyword_set(intervalle) AND NOT keyword_set(label) then label=1
if keyword_set(label) eq 0 then cas=0 else cas=label
label, cas, min, max, ncontour, level_z2d, colnumb, NLEVEL = nlevel $
, INTERVALLE = intervalle, strictfill = strictfill
;--------------------------------------------------------------
; choice of style
;-----------------------------------------------------------
if not keyword_set(style) then style=0
style,style,level_z2d,linestyle,thick
if keyword_set(inv) then colnumb=reverse(colnumb)
;----------------------------------------------------------------------
nby = n_elements(yy)
nbx = n_elements(xx)
;
if keyword_set(nan) then BEGIN
; xx = xx#replicate(1, nby) ; We make a 2d array with axes
; yy = replicate(1, nbx)#yy
masknan = finite(z2d)
z2d[where(masknan EQ 0)] = max
mask = temporary(mask)*temporary(masknan)
ENDIF
z2d = remplit(z2d,nite=2+keyword_set(nan), mask = mask, /basique, _extra=ex)
if NOT keyword_set(strictfill) then z2d = min > z2d < max
usetri = 0 ; default definition
if keyword_set(nan) then BEGIN
triangulation = triangule(mask, /basic, coinmonte = coinmontemask $
, coindescend = coindescendmask)
usetri = 1
ENDIF ELSE triangulation = -1
IF size(gdep, /n_dimensions) EQ 2 THEN BEGIN
usetri = 2
IF triangulation[0] EQ -1 THEN $
triangulation = triangule(mask, /basic, coinmonte = coinmontemask $
, coindescend = coindescendmask)
ENDIF
;----------------------------------------------------------------------
pltbase, z2d, xx, yy, mask, xx, yy, level_z2d, colnumb, contour = contour, /noerase $
, c_linestyle=linestyle,c_labels=1-(indgen(n_elements(level_z2d)) MOD 2) $
, trichamp = triangulation, trimsk = triangulation, overplot = overplot $
, c_thick=thick, performance = key_performance, usetri = usetri $
, coinmontemask=coinmontemask, coindescendmask=coindescendmask, _extra = ex
;------------------------------------------------------------
if n_elements(contour) eq 4 then BEGIN ; it is the second time I pass in pltt
contour = {mietma:[mi, ma], unit:varunit, inter:intervalle} ; I send back the min, the max and the unity
return
endif
;------------------------------------------------------------
if keyword_set(contour) then BEGIN
pourlegende = [1, 1, 1, 1]
oldattributs = saveatt()
oldcolnumb = colnumb
pltt,contour,type, contmin,contmax,CONTOUR=pourlegende, /noerase, USETRI = usetri $
,INTERVALLE=contintervalle,LABEL=contlabel,STYLE=style, ENDPOINTS = endpoints $
, NLEVEL = contnlevel, BOXZOOM = boxzoom, STRICTFILL = strictfill, _extra = ex
colnumb = oldcolnumb
restoreatt, oldattributs
endif
;----------------------------------------------------------------------
;----------------------------------------------------------------------
if keyword_set(overplot) then GOTO, fini
;------------------------------------------------------------
; Trace the line of change of date and the equator.
;------------------------------------------------------------
IF key_onearth THEN BEGIN
CASE type OF
'xt':oplot, [180, 180] - 360*(!x.range[1] LT 180), !y.range
'yt':oplot, !x.range, [0, 0]
ELSE:
ENDCASE
ENDIF
;------------------------------------------------------------
; caption + display of these.
;------------------------------------------------------------
legende,mi,ma,type, CONTOUR = pourlegende, DIREC = direc, INTERVALLE = intervalle $
, ENDPOINTS = endpoints, _extra = ex
;
; we want to draw the time axis with tick length = 1. if we simply
; use [xy]style=1 then each axis (up and down or left and right) have
; majorticks with a length of 1 (-> not very nice when xgridstyle=2),
; same if xticklen=0.5 (not very nice in the middle). => so we draw
; the top (right) axis by hand using axis.
;
if n_elements(ex) NE 0 then BEGIN
; pour avoir un cadre de la couleur noire
if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0
ENDIF
;
plot, [0], [0], /nodata, /noerase, _extra = ex $
, xstyle = 1+4*(keyword_set(endpoints) AND type EQ 'xt' AND lat1 NE lat2)+8*(type EQ 'yt' OR type EQ 'zt') $
, ystyle = 1+4*(keyword_set(endpoints) AND type EQ 'yt')+8*(type EQ 'xt')
; call axis for the missing axis.
IF type EQ 'xt' AND NOT keyword_set(endpoints) THEN BEGIN
if n_elements(ex) NE 0 then $
if (where(tag_names(ex) EQ 'YTICKNAME'))[0] NE -1 then $
ex.YTICKNAME = replicate(' ', n_elements(ex.YTICKNAME))
axis, yaxis = 1, ystyle = 1, yticklen = 0 $
, ytickname = replicate(' ', !y.ticks+1), _extra = ex
ENDIF
IF (type EQ 'yt' OR type EQ 'zt') AND NOT keyword_set(endpoints) THEN BEGIN
if n_elements(ex) NE 0 then $
if (where(tag_names(ex) EQ 'XTICKNAME'))[0] NE -1 then $
ex.XTICKNAME = replicate(' ', n_elements(ex.XTICKNAME))
axis, xaxis = 1, xstyle = 1, xticklen = 0 $
, xtickname = replicate(' ', !x.ticks+1), _extra = ex
ENDIF
; ajout d'un axe ds le cas ou l'on utilise endpoints
if keyword_set(endpoints) then addaxe, endpoints, type, posfenetre, _EXTRA = ex
;------------------------------------------------------------
; color bar
;------------------------------------------------------------
colnumb = colnumb[0:ncontour-1-keyword_set(strictfill)]
barrecouleur, colnumb, min, max, (ncontour-keyword_set(strictfill))/2 $
, position = posbar, _extra = ex
;------------------------------------------------------------
endif
;------------------------------------------------------------
; 1d
;------------------------------------------------------------
trace1d:
if (typdes eq '1d') then begin
if (not keyword_set(col1d)) then col1d = 0
if keyword_set(sty1d) then BEGIN ;if we want to make bars
IF strlowcase(strtrim(sty1d)) EQ 'bar' then begin
!y.range = [!y.range[0]-(!y.range[1]-!y.range[0])*.05,!y.range[1]]
bar_plot, yy, background = (!d.n_colors-1) < 255, $
baselines = replicate(!y.range[0], n_elements(yy)), barnames = ['', ''], $
colors = replicate(col1d, n_elements(yy)), /outline
if n_elements(ex) NE 0 then BEGIN
; To have a black frame
if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0
ENDIF
plot, [0], [0], /nodata, /noerase, _extra = ex
GOTO, fini
ENDIF
ENDIF
if NOT keyword_set(ov1d) then BEGIN
!y.range=[min-abs(max-min)/50.,max+abs(max-min)/50.]
legende,mi,ma,type, DIREC = direc, _extra = ex
;
if keyword_set(exchange_xy) then begin
rien = !x
!x = !y
!y = rien
rien = xx
xx = yy
yy = rien
endif
plot, xx, yy, color = col1d, linestyle = sty1d, thick = 2 $
, title = '', subtitle = '', _extra = ex
; draw 0 line
if keyword_set(exchange_xy) then $
oplot, [0, 0], !y.range ELSE oplot, !x.range, [0, 0]
; we want to draw the axis with the time axis length = 1. if we simply
; use xstyle=1 then each axis (up and down) have majorticks with a
; length of 1 (-> not very nice when xgridstyle=2), same if
; xticklen=0.5 (not very nice in the middle).
; => so we draw the top axis by hand using axis.
if n_elements(ex) NE 0 then BEGIN
; To have a black frame
if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0
ENDIF
plot, [0], [0], /nodata, /noerase $
, xstyle = 1+8*(1-keyword_set(exchange_xy)) $
, ystyle = 1+8*keyword_set(exchange_xy), _extra = ex
; call axis for the missing axis.
if n_elements(ex) NE 0 then BEGIN
; force tickname to blank array
if (where(tag_names(ex) EQ 'YTICKNAME'))[0] NE -1 AND keyword_set(exchange_xy) then ex.YTICKNAME = replicate(' ', n_elements(ex.YTICKNAME))
if (where(tag_names(ex) EQ 'XTICKNAME'))[0] NE -1 AND NOT keyword_set(exchange_xy) then ex.XTICKNAME = replicate(' ', n_elements(ex.XTICKNAME))
ENDIF
if keyword_set(exchange_xy) then axis, yaxis = 1, ystyle = 1 $
, yticklen = 0, ytickname = replicate(' ', !y.ticks+1), _extra = ex $
ELSE axis, xaxis = 1, xstyle = 1, xticklen = 0 $
, xtickname = replicate(' ', !x.ticks+1), _extra = ex
ENDIF ELSE oplot, xx, yy, color = col1d, linestyle = sty1d, thick = 2, _extra = ex
endif
fini:
;------------------------------------------------------------
; we reput time axis in IDL julian days and not in julian days count from tempsmin
;------------------------------------------------------------
if type EQ 'xt' then BEGIN
!y.range=!y.range+tempsmin
!y.tickv=!y.tickv+tempsmin
ENDIF ELSE BEGIN
!x.range=!x.range+tempsmin
!x.tickv=!x.tickv+tempsmin
ENDELSE
; We do a false plot to these values are considerated
plot, [0], [0], /nodata, /noerase, xstyle = 5, ystyle = 5 $
, title = '', subtitle = '', ytitle = '', xtitle = ''
;------------------------------------------------------------
;------------------------------------------------------------
; 3rd part: possible print
;------------------------------------------------------------
;------------------------------------------------------------
terminedessin, _extra = ex
if keyword_set(savedbox) THEN restoreboxparam, 'boxparam4pltt.dat'
;------------------------------------------------------------
if n_elements(key_performance) NE 0 then $
IF key_performance EQ 1 THEN print, 'temps pltt', systime(1)-tempsun
;------------------------------------------------------------
;------------------------------------------------------------
;------------------------------------------------------------
return
end