Re: Some questions about "contours on contours"

From: Mary Haley (haley AT XXXXXX)
Date: Mon Oct 18 2004 - 10:03:14 MDT

  • Next message: Bob Tomas: "turning off continental outline..."

    >
    > I have plotted "contours on contours" by imitating the examples in the
    > webpage:
    > http://www.cgd.ucar.edu/csm/support/CSM_Graphics/conOncon.shtml
    >
    > Now I am still confuced by the following:
    > ****************************************************************************
    > res3 = True ; plot mods desired
    > res3@mpCenterLonF = 180. ; center plot at 180
    > res3@cnLevelSelectionMode = "ExplicitLevels"
    > res3@cnLevels =
    > (/0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2/)
    > res3@gsnDraw = False ; Do not draw plot
    > res3@gsnFrame = False ; Do not advance frome
    > res3@cnInfoLabelOn = False ; turn off info label
    > ;****************************************************************************
    > res4 = True ; res2 probability plots
    > res4@mpCenterLonF = 180. ; center plot at 180
    > res4@gsnDraw = False ; Do not draw plot
    > res4@gsnFrame = False ; Do not advance frome
    > res4@cnInfoLabelOn = False ; turn off info label
    > res4@cnLinesOn = False ; do not draw contour lines
    > res4@cnLineLabelsOn = False ; do not draw contour labels
    >
    > res4@cnFillScaleF = 0.6 ; add extra density
    > ;***************Text Resource************************************
    > txres = True ; text mods desired
    > txres@txFontHeightF = 0.03 ; font smaller. default big
    > ;***************Polymark
    > Resource********************************************
    > polyres = True
    > polyres@gsMarkerIndex = 16 ; polymarker style
    > polyres@gsMarkerSizeF = 15. ; polymarker size
    > ;******************************************************************************
    > plot3 = gsn_csm_contour_map_ce(wks,t, res4)
    > plot3=ShadeLtGtContour(plot3,-2.576,17,2.576,3)
    >
    > plot4 = gsn_csm_contour(wks,gsn_add_cyclic_point(ccr), res3)
    > plot4 = ZeroNegDashLineContour (plot4)
    > gsn_text(wks,plot4,"H",lon(maxlonid),lat(maxlatid),txres)
    >
    > polymarker=gsn_add_polymarker(wks,plot4,lon(ptlon(lonid)),lat(ptlat(latid)),polyres)
    >
    > overlay (plot3, plot4)
    >
    > draw (plot3)
    > frame(wks)
    >
    > delete(plot3)
    > delete(plot4)
    >
    > plot3 = gsn_csm_contour_map_ce(wks,t, res4)
    > plot3=ShadeLtGtContour(plot3,-2.576,17,2.576,3)
    >
    > plot4 = gsn_csm_contour(wks,gsn_add_cyclic_point(ccr), res3)
    > plot4 = ZeroNegDashLineContour (plot4)
    > gsn_text(wks,plot4,"H",lon(maxlonid),lat(maxlatid),txres)
    >
    > polymarker=gsn_add_polymarker(wks,plot4,lon(ptlon(lonid)),lat(ptlat(latid)),polyres)
    >
    > overlay (plot3, plot4)
    >
    > draw (plot3)
    > frame(wks)
    >
    > delete(plot3)
    > delete(plot4)
    >
    >
    > As a result, I had two different (in size) shading pattern. But what I want
    > is just one Black&White version and one Color version of a same figure
    > (correlation contours with significance shading). Obviously, one of them is
    > wrong. Why?

    Dear Muhtarjan Osman,

    Without seeing a graphical example of what you are trying to do, I'm
    not fully sure how to tell you to correct the problem. Can you send me
    a personal email and attach a sample of what you have so far?

    One thing that might be the problem is that you are setting up
    two resource lists, "res3" and "res4", and they both have
    map resources set, but you are then passing one of them to
    "gsn_csm_contour", which is not a map routine. This is
    why you are getting the warning message:

        "warning:mpCenterLonF is not a valid resource in
         FS7-51slpda_vpda_0dLagBW_contour at this time"

    > Another thing is my output text "H" seems not in right spot. it has been
    > somewhat shifted.

    Again, I'm not sure what you mean here. Text is always centered about
    the X,Y values that you pass to gsn_text. If you want the X,Y value
    to represent some other position of your text box, like the bottom
    right, then you can use the "txJust" resource:

        txres@txJust = "BottomRight"

    To see other valid options, go to:

        http://ngwww.ucar.edu/ngdoc/ng/qsg/textitem/tx06.gif

    > And about the function "gsn_add_cyclic_point", why sometime we need to use
    > it to overlay two plots? I noticed some of examples in your webpage don't
    > use this function.

    This depends on your data. If you have global data, but it doesn't
    quite "meet" at the two longitude end points of your dataset, then you
    need to add the cyclic point so that you don't get a "seam" down the
    middle of your data when you plot it.

    If your data is regional, or if it is global but it fully wraps around
    the globe, then you don't need the cyclic point, and you should set
    "res@gsnAddCyclic" to False.

    The gsn_add_cyclic_point function tries to be smart and figure out if
    the cyclic point needs to be added. It will issue a warning message if
    it thinks your data is should not have the cyclic point added.

    --Mary

    > Muhtarjan Osman
    > ASGG
    > LAWR
    > UC Davis
    >
    > _________________________________________________________________
    > Don’t just search. Find. Check out the new MSN Search!
    > http://search.msn.click-url.com/go/onm00200636ave/direct/01/
    >
    > _______________________________________________
    > ncl-talk mailing list
    > ncl-talk AT ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    >

    -- 
    -------------------------------------------------
    Mary Haley                   haley AT ucar.edu
    NCAR/SCD/VETS                303-497-1254 (voice)
    1850 Table Mesa Dr           303-497-1804 (fax)
    Boulder, CO  80305
    -------------------------------------------------
    _______________________________________________
    ncl-talk mailing list
    ncl-talk AT ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    



    This archive was generated by hypermail 2b29 : Mon Oct 18 2004 - 10:09:54 MDT