Re: scale

From: Mary Haley (haley AT ucar.edu)
Date: Thu Jun 09 2005 - 08:03:57 MDT

  • Next message: John Filipkowski: "Want to download "WRF_contributed.ncl" file to process WRF output files..."

    Ben,

    You can try setting:

         res@trYMinF = 0.
         res@trYMaxF = 100.

    which tells NCL to force your Y axis to start at 0 and end at 100.

    However, if your data has a Y coordinate array that is not
    equally-spaced, and its minimum or maximum values are not at least 0
    and 100, then NCL will not know how to extrapolate the extra points
    outside the values of your Y coordinate array.

    If your Y coordinate array doesn't at least go from 0 to 100, then you
    may need to create a new data array that is dimensioned (ny+2) x (nx),
    where ny x nx is the size of your original array. Then, you
    would assign it and its new Y coordinate array as follows (this
    is untested code):

         dims = dimsizes(data) ; Get dimension sizes of data
         ny = dims(0)
         nx = dims(1)
         newdata = new((/ny+2,nx/),typeof(data)) ; Create new data array
         newy = new(ny+2,typeof(data&$data!0$))

         newdata(0,:) = data@_FillValue ; Assign values to new data array
         newdata(1:ny,:) = (/data/)
         newdata(ny+1,:) = data@_FillValue
         newy(0) = 0. ; Assign values to new coord array
         newy(1:ny) = data&$data!0$
         newy(ny+1 = 100.

    On Wed, 8 Jun 2005, Benjamin Lamptey wrote:

    > Hello,
    > I want to make my legend (or rather scale) go from 0 to 100. That is, I want the
    > label to have 0 and 100 appearing. The way I have it now, 10 to 90 appear with
    > the leftmost and rightmost edges not bearing any number. The 0 and 100 have to be
    > assumed.
    >
    > I used the following resources;
    >
    > res@cnFillColors = (/2,16,32,40,56,63,69,79,88,95/)
    > res@cnLevels = (/10,20,30,40,50,60,70,80,90/)
    >
    > I shall appreciate any help to be able to include 0 and 100 as the
    > first and last numbers.
    >
    > 2) Note that if I increase my FillColor levels and cnLevels and include 0 and
    > 100, the scale will be drawn as if, it starts from -10 and ends at 110.
    > I want to avoid that.
    >
    > Thanks
    > Ben
    > --
    >
    >
    > Benjamin L. Lamptey Phone: (814) 865-9911 (office)
    > Pennstate (EMS Environment Institute) (814) 237-8193 (home)
    > 2217 Earth-Engineering Sciences Bldg Fax : (814) 865-3191
    > University Park, PA 16802 WWW:http://www.essc.psu.edu/~lamptey
    >
    >
    >
    > _______________________________________________
    > ncl-talk mailing list
    > ncl-talk@ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    >
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Thu Jun 09 2005 - 08:22:57 MDT