[ncl-talk] gsn_add_polymarker when pass student t test

Mary Haley haley at ucar.edu
Tue Oct 31 08:33:21 MDT 2017


Zhen,

If the dots are not showing up on your plot, this is usually because the
values you are passing to gsn_add_polymarker are outside the range of your
data. I think that you simply have the two arguments to gsn_add_polymaker
swapped.

Try changing:

    dot(iex,ip) = gsn_add_polymarker
(wks,plot(iex),lat(indices(ip,1)),plev(indices(ip,0)),resmarker)

to:

    dot(iex,ip) = gsn_add_polymarker(wks,plot(iex)
,plev(indices(ip,0)),lat(indices(ip,1)),resmarker)

The third argument should be the *Y* locations of the dots, and the fourth
argument the *X* locations.

Also, you don't need a do loop to plot each marker, especially since you
are not changing the marker style inside the loop.  Take this code:

  do ip=0,npts-1

    dot(iex,ip) =
gsn_add_polymarker(wks,plot(iex),lat(indices(ip,1)),plev(indices(ip,0)),resmarker)

  end do

and replace it with:

    dot(iex) = gsn_add_polymarker
(wks,plot(iex),lat(indices(:,1)),plev(indices(:,0)),resmarker)

You will also need to change the "new" command for "dot" to:

dot=new(dimsizes(forc),graphic)

--Mary



On Mon, Oct 30, 2017 at 2:05 PM, 刘振 <286909655 at qq.com> wrote:

> Dear all,
>
>   I am using ncl 6.4 to plot and want to print dot when value pass student
> t test using function gsn_add_polymaker (script and figure attached). But
> the dots are only printed at some levels (not all levels) in vertical
> direction. Actually, I got 23 pressure levels for my data and indeed some
> dot are not printed on the plot when I print the indices passing
> significance level. Could you please help me to solve this problem. Thanks.
>
> Best regards,
> zhen
>
> ------------------
> 刘振
> 中山大学
> 环境科学与工程学院
> 大气科学系
> Phone: +86-15013246049 <+86%20150%201324%206049>
> Liu  Zhen
> Department of Atmospheric Science
> School of Environmental Science and Engineering
> Sun Yat-sen University
> Email address: liuzhen9 at mail2.sysu.edu.cn
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171031/1d012dec/attachment.html>


More information about the ncl-talk mailing list