;+
;
; @file_comments
; Add an axis when we do an oblique section in pltz,
; pltt
; or plt1d
;
; @categories
; Graphics
;
; @param ENDPOINTS {in}{required}
; Coordinate of extremities of the section
;
; @param TYPE {in}{required}{type=string}
; A string of two characters specifying the type of plot we do
;
; @param POSFENETRE {in}{required}{type=vector}
; The vector !p.position corresponding to the frame position of
; the drawing part of the plot.
;
; @uses
; common.pro
;
; @history
; Sebastien Masson (smasson\@lodyc.jussieu.fr)
;
; @version
; $Id$
;
;-
;
PRO addaxe, endpoints, type, posfenetre, _EXTRA = ex
;
compile_opt idl2, strictarrsubs
;
@common
;---------------------------------------
IF strpos(type, 'x') NE -1 THEN BEGIN
IF endpoints[1] EQ endpoints[3] THEN return
IF key_onearth THEN BEGIN
formeaxe0 = 'lonaxe'
formeaxe1 = 'lataxe'
titreaxe = 'latitude'
ENDIF ELSE BEGIN
formeaxe0 = ''
formeaxe1 = ''
titreaxe = 'j index'
ENDELSE
range = [endpoints[1], endpoints[3]]
if endpoints[2] LT endpoints[0] THEN range = reverse(range)
ENDIF ELSE BEGIN
IF endpoints[0] EQ endpoints[2] THEN return
IF key_onearth THEN BEGIN
formeaxe0 = 'lataxe'
formeaxe1 = 'lonaxe'
titreaxe = 'longitude'
ENDIF ELSE BEGIN
formeaxe0 = ''
formeaxe1 = ''
titreaxe = 'i index'
ENDELSE
range = [endpoints[0], endpoints[2]]
if endpoints[3] LT endpoints[1] THEN range = reverse(range)
ENDELSE
if type EQ 'yt' then BEGIN
axis,yaxis=0,ytickformat=formeaxe0,color=0,ystyle = 1, _EXTRA = ex
axis,yaxis=1,ytickformat=formeaxe1,color=0,ystyle = 1,ytitle=titreaxe, yrange = range, _EXTRA = ex
ENDIF ELSE BEGIN
axis,xaxis=0,xtickformat=formeaxe0,color=0,xstyle = 1,_EXTRA = ex
axis,xaxis=1,xtickformat=formeaxe1,color=0,xstyle = 1,xtitle=titreaxe, xrange = range, _EXTRA = ex
ENDELSE
;---------------------------------------
return
end