Re: pattern line color

From: Sanjiv Kumar <skumar.water_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 30 2014 - 12:53:07 MST

Thanks Adam.

This is how i did it, may be helpful to other NCLers

;*******************************
  res2 = True
  res2@gsnDraw = False ; don't draw yet
  res2@gsnFrame = False ; don't advance fra
  res2@gsnMaximize = True

   res2@cnInfoLabelOn = False ; turn off info label
   res2@cnLinesOn = False ; do not draw contour lines
   res2@cnFillOn = True
   res2@cnLineLabelsOn = False ; do not draw contour labels
   res2@gsnAddCyclic = True

   res2@lbLabelBarOn = False
   res2@cnMonoFillColor = False ; default color is fground
[black]
   res2@cnMonoFillPattern = False ; want multiple patterns
   res2@cnMonoFillScale = False ; want patterns w/ diff
densities

   res2@cnLevelSelectionMode = "ManualLevels"
   res2@cnMinLevelValF = 0.0
   res2@cnMaxLevelValF = 3.0
   res2@cnLevelSpacingF = 0.5

  ;***Here i want to put pattern for all values greater than 2.0 hence i am
using -1 for all values less than 2.0

   res2@cnFillPatterns = (/ -1, -1, -1, -1, -1, 6, 6, 6/) ;
-1=trasparent

;(/less than 0, less than 0.5, less than 1., less than 1.5, less than 2.0,
less than 2.5, less than 3.0, gretaer than 3.0/)
   res2@cnFillScales = (/1., 1., 1., 1., 1., 0.5, 0.5, 0.5/) ; add
extra density
   res2@cnFillColors = (/"white", "white", "white", "white", "white",
"azure2", "azure2", "azure2"/)

plots3 = gsn_csm_contour(wks, var1_ct, res2)

overlay(plots, plots3)

;***************************************************************

best regards
Sanjiv Kumar

On Wed, Jan 29, 2014 at 3:18 PM, Adam Phillips <asphilli@ucar.edu> wrote:

> Hi Sanjiv,
> gsn_contour_shade was written to be very flexible, allowing users to
> either color fill or pattern fill. But it unfortunately does not allow one
> to choose a color for a pattern fill. See a response I gave a few years ago
> to a user asking the same question:
> http://www.ncl.ucar.edu/Support/talk_archives/2010/0694.html
> Adam
>
>
> On 01/29/2014 02:20 PM, Sanjiv Kumar wrote:
>
> Hello:
>
> I am using "gsn_contour_shade" to draw hatching pattern on a map.
>
>
> ;******************************
> opt = True
> opt@gsnShadeFillType = "pattern" ; pattern fill
> opt@gsnShadeHigh = 3
> plots3(i) = gsn_csm_contour(wks, var1_ct(ind_num(i), :, :), res2)
> plots3(i) = gsn_contour_shade(plots3(i), -9999.0, 2.0, opt)
> overlay(plots(i), plots3(i))
> ;*******
>
> It draws the hatching pattern "////" in black color. I want to draw the
> hatching pattern in a different color e.g. blue color "////" .
>
> I am not sure how to do it. Any clue? I really appreciate your help.
>
> thanks
> sanjiv kumar
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> --
> ______________________________________________________________
> Adam Phillips asphilli@ucar.edu
> NCAR/Climate and Global Dynamics Division (303) 497-1726
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/staff/asphilli
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jan 30 12:53:23 2014

This archive was generated by hypermail 2.1.8 : Fri Feb 07 2014 - 16:39:11 MST