!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! @ p_box.greg
! J.Pety 2005
!
! &1: action (label or nothing)
! &2: aaa
!
! Comment: a bit inefficient because legend is always defined but used
!          only when action is equal to label...
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
define logical seconds absolute
define character action*8 kind*1 label*1 legend*16
let action "&1" /lower
!
greg2\rgdata &2 /variable
!
! x axis
!
! Label definition
if ((action.eq."label").and.(do_label)) then
   let label "p"
else
   let label "n"
endif
!
! Legend and coordinate definitions
if (&2%unit1.eq."RA") then
   if (abs(&2%angle).gt.1E-5) then
      let legend "\Gdx (`)"
      let kind "s" ! Seconds
   else if (do_rcoord) then
      let legend "\GdR.A. (`)"
      let kind "s" ! Seconds
   else
      let legend "R.A."
      let kind "a" ! Absolute
   endif
else if (&2%unit1.eq."DEC") then
   if (abs(&2%angle).gt.1E-5) then
      let legend "\Gdy  (`)"
      let kind "s" ! Seconds
   else if (do_rcoord) then
      let legend "\GdDec  (`)"
      let kind "s" ! Seconds
   else
      let legend "Dec"
      let kind "a" ! Absolute
   endif
else
   let legend '&2%unit1'
   let kind "o" ! Other
endif
!
! Box drawing
if (kind.eq."s") then
   greg1\axis xu /unit sec /label n
   greg1\axis xl /unit sec /label 'label'
else if (kind.eq."a") then
   greg1\axis xu /abs /label n
   greg1\axis xl /abs /label 'label'
else
   greg1\axis xu /label n
   greg1\axis xl /label 'label'
endif
!
! Legend drawing
!if ((action.eq."label").and.(do_legend)) then
!   greg1\label 'legend' /x
!endif
!
! y axis
!
! Label definition
if ((action.eq."label").and.(do_label)) then
   let label "o"
else
   let label "n"
endif
!
! Legend and coordinate definitions
if (&2%unit2.eq."RA") then
   if (abs(&2%angle).gt.1E-5) then
      let legend "\Gdx (`)"
      let kind "s" ! Seconds
   else if (do_rcoord) then
      let legend "\GdR.A. (`)"
      let kind "s" ! Seconds
   else
      let legend "R.A."
      let kind "a" ! Absolute
   endif
else if (&2%unit2.eq."DEC") then
   if (abs(&2%angle).gt.1E-5) then
      let legend "\Gdy (`)"
      let kind "s" ! Seconds
   else if (do_rcoord) then
      let legend "\GdDec (`)"
      let kind "s" ! Seconds
   else
      let legend "Dec"
      let kind "a" ! Absolute
   endif
else
   let legend '&2%unit2'
   let kind "o" ! Other
endif
!
! Box drawing
if (kind.eq."s") then
   greg1\axis yr /unit sec /label n
   greg1\axis yl /unit sec /label 'label'
else if (kind.eq."a") then
   greg1\axis yr /abs /label n
   greg1\axis yl /abs /label 'label'
else
   greg1\axis yr /label n
   greg1\axis yl /label 'label'
endif
!
RETURN
!
! Legend drawing
if ((action.eq."label").and.(do_legend)) then
   greg1\label 'legend' /y
endif
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
