[ncl-talk] cross section label

Debasish Hazra debasish.hazra5 at gmail.com
Wed Feb 13 14:27:40 MST 2019


Hi,
I am having problem with lat lon label in cross section plot. Below is my
ncl plot script with input 3d data in lev, lat ,lon format and I am zooming
over a particular location. Cross section latitiude is between 49-52N, but
longitude is between 10W to 2E. But my plot xlabel shows longitudes between
-10E to 2E. How do I modify it.

res      = True               ; plot options desired
  res at gsnDraw = False
  res at gsnFrame = False

   lat1= 49.0
   lat2 = 52.0
   lon1 = -10.0
   lon2  = 2.0
   npts=30
   pts = gc_latlon(lat1,lon1,lat2,lon2,npts,-2)
   nLabels=8
    XBValues    = toint( fspan(0,npts-1,nLabels) )
    XBLabels    = new(nLabels,"string")
   do i=0,nLabels-1
     x = pts at gclon(XBValues(i))
     y = pts at gclat(XBValues(i))
     XBLabels(i) = sprintf("%5.1f", y)+"~S~o~N~N"+"~C~"+sprintf("%5.1f",
x)+"~S~o~N~E"
 end do

 print(XBValues)
 print(XBLabels)

   res at tmXBMode            = "Explicit"    ; explicitly label x-axis
 res at tmXBValues = XBValues
 res at tmXBLabels = XBLabels

................

 data1_xs = linint2_points_Wrap(reorder1&lons1,reorder1&lats1,reorder1, \
                              False,pts at gclon,pts at gclat,0)
        plot_A(0) = gsn_csm_pres_hgt (wks, data1_xs({1000:200},:), res)


Input data Variable: reorder1
Type: float
Total Size: 16680960 bytes
            4170240 values
Number of Dimensions: 3
Dimensions and sizes:   [levs1 | 64] x [lats1 | 181] x [lons1 | 360]
Coordinates:
            levs1: [988.4774..0.266703]
            lats1: [-90..90]
            lons1: [-180..179]
Number Of Attributes: 2
  _FillValue :  1e+20
  lonFlip :     longitude coordinate variable has been reordered via lonFlip


Attached resulting figure.Any help.

Thanks

Debasish.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190213/2821c799/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Profile_sulf_2017.png
Type: image/png
Size: 113074 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190213/2821c799/attachment.png>


More information about the ncl-talk mailing list