[ncl-talk] Do not show significance level in a correlation map

Adam Phillips asphilli at ucar.edu
Fri Jan 12 14:55:10 MST 2024


Hi Jalal,
As you are pattern filling, and the default is color filling, you need to
set:
opt at gsnShadeFillType = "pattern"
I am also unclear what you mean by this statement:
"...to show the significance level as a shaded pattern where p value is
less than 0.05 and 0.01"

Do you want to stipple areas less than .05? If so the following code should
do that:
  opt                      = True
  opt at gsnShade*Low*         = 17          ; stipple
  opt at gsnShadeFillScaleF   = 0.5         ; add extra density
  plot2 = gsn_contour_shade(plot2,0.05,999.,opt)

If instead you want to stipple areas less than .01, you will need to modify
the contour levels in your res2 resource list to have a contour at .01:
  res2 at cnMinLevelValF      = 0.00        ; set min contour level
  res2 at cnMaxLevelValF      = .10        ; set max contour level
  res2 at cnLevelSpacingF     = 0.01        ; set contour spacing

  opt                      = True
  opt at gsnShade*Low*         = 17          ; stipple
  opt at gsnShadeFillScaleF   = 0.5         ; add extra density
  plot2 = gsn_contour_shade(plot2,0.01,999.,opt)\

Hope that answers your question. As always please respond to the ncl-talk
email list with further questions.
Best,
Adam

On Fri, Jan 5, 2024 at 6:15 AM Md. Jalal Uddin via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Dear all,
>
> I have tried to use the gsn_contour_shade function to show the
> significance level as a shaded pattern where p value is less than 0.05 and
> 0.01. However, the output map does not show the shaded areas (please see
> the attached map).
>
> Here are some codes:
> r_sst  = escorc(ano_nino,ano_sstSON(lat|:,lon|:,time|:))        ;
> ccr(lat,lon)
> copy_VarCoords(ano_sstSON(0,:,:), r_sst)
> r_sst at long_name = "Correlation: r_sst"
>
>   p = rtest(r_sst,42,0)
>   copy_VarCoords(r_sst, p)
>
> opt                      = True
> opt at gsnShadeHigh         = 17          ; stipple
> opt at gsnShadeFillScaleF   = 0.5         ; add extra density
> opt at gsnShadeFillDotSizeF = 0.002      ; make dots larger
>
>   plot = gsn_csm_contour_map(wks,r_sst, res)  ; create plot
>
>   plot2 = gsn_csm_contour(wks,p, res2)
>   plot2 = gsn_contour_shade(plot2,0.01,0.05,opt)
>
>   overlay (plot, plot2)
>
>  draw(plot)
>  frame(wks)
>
> Please find the full code in the attached file.
>
> Any suggestions would be appreciated.
>
> --
>
> *Regards,*
>
> Dr. Jalal
>
> *Postdoctoral Researcher,* Typhoon Research Center, Jeju National
> University, South Korea
>
> *PhD* in Atmospheric Physics and Atmospheric Environment, NUIST, China
>
> *M.Sc.* in Applied Meteorology, NUIST, China
>
> *B.Sc.* in Disaster Management, PSTU, Bangladesh
>
> *Founder and Director* of Research Society
>
> *Website*: https://researchsociety20.org/founder-and-director/
>
> *E-mails*: founder-and-director at researchsociety20.org
>
>               jalal at jejunu.ac.kr
>
>               20205103002 at nuist.edu.cn
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist IV, Climate Analysis Section
Climate and Global Dynamics Laboratory
National Center for Atmospheric Research
www.cgd.ucar.edu/staff/asphilli/

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20240112/87bb277c/attachment.htm>


More information about the ncl-talk mailing list