axis label control using gsn_csm_contour_map

From: Matt Fearon (matthew.fearon AT XXXXXX)
Date: Fri Jun 22 2001 - 09:44:03 MDT

  • Next message: Mary Haley: "Re: axis label control using gsn_csm_contour_map"

    Dear NCL users:

    I am having trouble controling the display of longitude labels on a
    map for data I plot. I had this trouble before and I was able to
    remedy it by setting tickmark resources. I have recently upgraded
    from NCL 4.2.0.a014 to 4.2.0.a018 and now my troubles are back.
    Due to some other trouble I had with gsn_code.ncl and gsn_csm.ncl
    supplied in version a018, I retrieved the latest versions of these.

    I have attached my ncl script below. The data plots fine. However,
    I cannot control the XB labeling using tmXBTickSpacingF (note
    I have this commented out). If I try to set this resource, I receive
    the following errors;

    fatal:Assignment type mismatch, right hand side can't be coerced to type
    of left hand side
    fatal:Execute: Error occurred at or near line 2514 in file
    /home/mgf9/gsn_csm.ncl

    fatal:Execute: Error occurred at or near line 3149 in file
    /home/mgf9/gsn_csm.ncl

    fatal:Execute: Error occurred at or near line 3557 in file
    /home/mgf9/gsn_csm.ncl

    fatal:Execute: Error occurred at or near line 6391 in file
    /home/mgf9/gsn_csm.ncl

    fatal:Execute: Error occurred at or near line 102

    If I comment out this resource, things work fine but I cannot control
    the x axis labeling. Suggestions would be greatly appreciated.

    Thank you,
    Matt
    matthew.fearon@yale.edu

    my script;

    load "/home/mgf9/gsn_code.ncl"
    load "/home/mgf9/gsn_csm.ncl"
    ;load "/usr/local/ncarg/lib/ncarg/nclscripts/csm/gsn_code.ncl"
    ;load "/usr/local/ncarg/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
    load "/usr/local/ncarg/lib/ncarg/nclscripts/csm/shea_util.ncl"
    load "/usr/local/ncarg/lib/ncarg/nclscripts/csm/contributed.ncl"

    begin

    nx=2881
    ny=1801
    irec=0

    ;** File generated using Fortran 90, therefore dimensions are
    ;** reversed in NCL (Fortran (nx,ny), NCL (ny,nx))
    f="/squall/mgf9/data/map/dem/alps.dem"

    ddem=new((/ny,nx/),"float",-9999.)
    ddem=fbindirread(f,irec,(/ny,nx/),"float")
    ddem!0="lat"
    ddem!1="lon"

    irec=0
    f1="/squall/mgf9/data/map/dem/alps.lat.dem"
    latcoord=new((/ny/),"float")
    latcoord=fbindirread(f1,irec,(/ny/),"float")
    latcoord@units = "degrees_north"

    f2="/squall/mgf9/data/map/dem/alps.lon.dem"
    loncoord=new((/nx/),"float")
    loncoord=fbindirread(f2,irec,(/nx/),"float")
    loncoord@units = "degrees_east"

    ddem&lat = latcoord
    ddem&lon = loncoord
    ;*******************************************************************

     wks = gsn_open_wks ("X11", "plot")
     gsn_define_colormap (wks,"gui_default")

     res = True
     res@gsnDraw = False
     res@gsnFrame = False
     res@gsnMaximize = True

     res@gsnSpreadColors = True
     res@gsnSpreadColorStart = 4
     res@gsnSpreadColorEnd = -1
     res@gsnAddCyclic = False

     res@mpLimitMode = "LatLon"
     res@mpMinLatF = 45.5
     res@mpMaxLatF = 48.
     res@mpMinLonF = 8.
     res@mpMaxLonF = 13.
     res@mpProjection = "CylindricalEquidistant" ; default

     res@mpOutlineDrawOrder = "PostDraw"
     res@mpGridLineDashPattern = 2
     res@mpPerimOn = True
     res@mpPerimDrawOrder = "PostDraw"
     res@mpOutlineOn = True

     res@mpOutlineBoundarySets = "National"
     res@mpGeophysicalLineThicknessF = 1.5
     res@mpGridAndLimbOn = True
     res@mpGridSpacingF = 2.
     res@mpGridLatSpacingF = 2.
     res@mpGridLonSpacingF = 2.
     res@mpLabelsOn = True
     res@tmXBMode = "Manual"
     res@tmXBDataLeftF = 8. ; min(loncoord)
     res@tmXBDataRightF = 13. ; max(loncoord)
     res@tmXBTickStartF = 8. ; min(loncoord)
     res@tmXBTickEndF = 13. ; max(loncoord)
     ;res@tmXBTickSpacingF = 2.

     res@tfDoNDCOverlay = True

     res@cnRasterModeOn = True ; Raster plotting
     res@cnFillOn = True ; color fill
     res@cnLinesOn = False
     res@cnInfoLabelOn = False ; Turn off contour info label
     res@cnLineLabelsOn = False
     res@cnLevelSelectionMode = "ManualLevels"
     res@cnMinLevelValF = 0.
     res@cnMaxLevelValF = 3600.
     res@cnLevelSpacingF = 200.

     res@lbAutoManage = False ; Modify label bar
     res@pmLabelBarDisplayMode = "Never" ; turns on label bar
     res@lbOrientation = "Horizontal" ; ncl default is
    vertical
     res@lbLabelStride = 2 ; skip every other label

     res@lbLabelFontHeightF = .012 ; default is HUGE
     res@lbPerimOn = False ; default has box

     txres = True
     txres@txFontHeightF = 0.02
     gsn_text_ndc(wks,"1km Alpine DEM",0.49,0.89,txres)

     plot = gsn_csm_contour_map(wks,ddem({45.5:48.},{8.:13.}),res)

     draw(plot)
     frame(wks)
    end



    This archive was generated by hypermail 2b29 : Mon Jun 25 2001 - 10:32:10 MDT