Re: Drawing order for polymarkers

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Thu, 10 Sep 2009 10:14:08 -0600

Thanks for that pointer, Adam -- I was unaware of these resources.

It looks like if finer grain control over which lines/markers/polygons
get drawn first/last can be controlled with a related resource:
"tfPolyDrawList". The following snippet draws two filled and
overlapping boxes over a map of US:

   boxes = new((/2/), graphic)
   bRes=True
   bRes_at_gsFillColor = "green"
   x = (/-110, -90, -90, -110/)
   y = (/40, 40, 30, 30/)
   boxes(1) = gsn_add_polygon(wks, plot, x, y, bRes)

   bRes_at_gsFillColor = "red"
   x = (/-100, -80, -80, -100/)
   y = (/35, 35, 25, 25/)
   boxes(0) = gsn_add_polygon(wks, plot, x, y, bRes)

   dummy = new(1,graphic)
   NhlAddPrimitive(plot, boxes, dummy)

In this case, the green box is drawn last. Reordering the assignments
in "boxes" causes the red polygon to be drawn last.

FWIW...
Rick

On Sep 10, 2009, at 9:22 AM, Adam Phillips wrote:

> Hi Dave,
> I just became aware of this resource recently:
> res_at_tfPolyDrawOrder = "PreDraw" ; Draw any attached
> primitives
> ;
> before rest of plot.
> http://www.ncl.ucar.edu/Document/Graphics/Resources/tf.shtml#tfPolyDrawOrder
>
> So give tfPolyDrawOrder a shot and let us know if that solves your
> problem..
> Best regards,
> Adam
>
> Dave Allured wrote:
>> NCL team,
>>
>> I need to control the drawing order of polylines and polymarkers.
>> In a typical case, the base plot is made with
>> gsn_csm_vector_scalar_map_ce, plus an overlay made with
>> gsn_csm_contour.
>>
>> I find a number of DrawOrder resources, but none seem to apply to
>> objects made with gsn_add_poly* functions. In general, what is the
>> right way to control drawing order for these? I'm using NCL 5.1.1.
>> Thanks for your help.
>>
>> Dave Allured
>> CU/CIRES Climate Diagnostics Center (CDC)
>> http://cires.colorado.edu/science/centers/cdc/
>> NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
>> http://www.cdc.noaa.gov/psd1/
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> --------------------------------------------------------------
> Adam Phillips asphilli_at_ucar.edu
> National Center for Atmospheric Research tel: (303) 497-1726
> ESSL/CGD/CAS fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Sep 10 2009 - 10:14:08 MDT

This archive was generated by hypermail 2.2.0 : Tue Sep 15 2009 - 16:03:21 MDT