Re: plotting data inside a state boundary

From: Mary Haley (haley AT ucar.edu)
Date: Wed Jul 13 2005 - 07:47:23 MDT

  • Next message: jerry: "resource file problem"

    I was working on a short example when Dave posted this message. I'll
    include the example here since it shows how to draw just Caliornia
    with no map fill. These same resources can be used when calling the
    gsn_csm_contour_map function (in order to overlay contours on the map
    of California).

    --Mary

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

    begin
       wks = gsn_open_wks("x11","california")

       res = True
       res@mpFillOn = False
       res@mpOutlineBoundarySets = "NoBoundaries"
       res@mpOutlineSpecifiers = "us-california"
       res@mpProjection = "LambertEqualArea"
       res@mpLimitMode = "LatLon"
       res@mpCenterLonF = -125.
       res@mpCenterLatF = 35.
       res@mpMinLatF = 30
       res@mpMaxLatF = 45.
       res@mpMinLonF = -132.
       res@mpMaxLonF = -110.
       res@gsnMaximize = True

       map = gsn_csm_map(wks,res)

    end

    On Tue, 12 Jul 2005, David Ian Brown wrote:

    > Hi Mike,
    >
    > Assuming you are drawing a filled map (res@mpFillOn = True),
    > then you can avoid filling California by setting the
    > array resource
    >
    > res@mpFillAreaSpecifiers = (/ "us-california" /) ; mpDataBaseVersion set
    > to "LowRes"
    >
    > or
    >
    > res@mpFillAreaSpecifiers = (/ "california" /) ; mpDataBaseVersion set to
    > "MediumRes"
    >
    > Masking is not supported if mpDataBaseVersion is set to "HighRes".
    >
    > Depending on how you draw the data, you may need to set the resource
    >
    > res@mpFillDrawOrder = "PostDraw"
    >
    > in order for the map fill colors to cover the data you want to hide.
    >
    > -dave
    >
    >
    >
    > On Jul 12, 2005, at 4:21 PM, brownmc@uci.edu wrote:
    >
    >> Hi all,
    >> I am trying to make a plot, using global data, that just displays the data
    >> for the state of California. I am wondering if there is a mask for
    >> California that I am not able to find or if there is a way to generate a
    >> mask for it. I am currently using the Lambert Equal Area projection to
    >> display the plot. I will not include my script because it is kinda long,
    >> but if it will help answer the question I can include it in another
    >> e-mail. Thanks
    >>
    >> Mike Brown
    >>
    >>
    >> _______________________________________________
    >> 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
    >
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Wed Jul 13 2005 - 11:35:47 MDT