[ncl-talk] Significance with contour: positive in solid line andnegative in dash line

Mary Haley haley at ucar.edu
Fri Aug 17 08:43:02 MDT 2018


Zhen,

I would need to see your script, and maybe your data (which you can email
if it's small) in order to understand what's going on. It looks like you
have two contour plots overlaid. Is it possible you are applying the wrong
set of resources to the wrong data?

--Mary


On Thu, Aug 16, 2018 at 8:43 PM, 刘振 <286909655 at qq.com> wrote:

> Dear Mary,
>
>   Thanks a lot for you reply and very good suggestions.
>   Your methods perfectly solve my second problem.
>   But, for the first one, it is, somehow, a little tricky. The contour
> line I want to plot represents p value (according to student's t test),
> which is always positive. In order to plot the positive (value in shading)
> with solid line while negative with dash line, I use ‘prob=where(var.lt.0
> ,-prob,prob)’ in my script to change the p value (i.e., prob) first. Then
> I plot the p value using contour with negative p value in dash. But the
> region at 95% significant area totally changed. Please check the
> differences between the two outputs attached. The var.pdf should be the
> right one. Could you please help me to solve this issue. Thanks.
>
> Best regards,
> zhen
>
> ------------------
> 刘振
> 中山大学
> 环境科学与工程学院
> 大气科学系
> Phone: +86-15013246049
> Liu  Zhen
> Department of Atmospheric Science
> School of Environmental Science and Engineering
> Sun Yat-sen University
> Email address: liuzhen9 at mail2.sysu.edu.cn
>
>
>
> ------------------ 原始邮件 ------------------
> *发件人:* "Mary Haley"<haley at ucar.edu>;
> *发送时间:* 2018年8月17日(星期五) 上午7:49
> *收件人:* "刘振"<286909655 at qq.com>;
> *抄送:* "ncl-talk"<ncl-talk at ucar.edu>;
> *主题:* Re: [ncl-talk] Significance with contour: positive in solid line
> andnegative in dash line
>
> Dear Zhen,
>
> One way to find out if there's an example for something specific you are
> trying to do, you can use the "tips" link on the examples page:
>
> List of tips <http://www.ncl.ucar.edu/Applications/concepts_list.shtml>,
> resources <http://www.ncl.ucar.edu/Applications/res_list.shtml>,
> functions/procedures
> <http://www.ncl.ucar.edu/Applications/func_list.shtml> and the example
> scripts they appear in.
>
>
> Which takes you to this page:
>
> http://www.ncl.ucar.edu/Applications/concepts_list.shtml
>
> You can then use your browser search to search for "negative" or
> "positive".  You will find this under the search for "negative":
>
> *Drawing negative contour lines as dashed lines*
>     conOncon_1.ncl
> <http://www.ncl.ucar.edu/Applications/Scripts/conOncon_1.ncl> (contours
> on contours <http://www.ncl.ucar.edu/Applications/conOncon.shtml#ex1>)
>     conOncon_2.ncl
> <http://www.ncl.ucar.edu/Applications/Scripts/conOncon_2.ncl> (contours
> on contours <http://www.ncl.ucar.edu/Applications/conOncon.shtml#ex2>)
>     conOncon_4.ncl
> <http://www.ncl.ucar.edu/Applications/Scripts/conOncon_4.ncl> (contours
> on contours <http://www.ncl.ucar.edu/Applications/conOncon.shtml#ex4>)
>     coneff_3.ncl
> <http://www.ncl.ucar.edu/Applications/Scripts/coneff_3.ncl> (contour
> effects <http://www.ncl.ucar.edu/Applications/coneff.shtml#ex3>)
>     coneff_5.ncl
> <http://www.ncl.ucar.edu/Applications/Scripts/coneff_5.ncl> (contour
> effects <http://www.ncl.ucar.edu/Applications/coneff.shtml#ex5>)
>     coneff_6.ncl
> <http://www.ncl.ucar.edu/Applications/Scripts/coneff_6.ncl> (contour
> effects <http://www.ncl.ucar.edu/Applications/coneff.shtml#ex6>)
>     coneff_9.ncl
> <http://www.ncl.ucar.edu/Applications/Scripts/coneff_9.ncl> (contour
> effects <http://www.ncl.ucar.edu/Applications/coneff.shtml#ex9>)
>
>
> I recommend clicking on the link inside the "(...)" and not the actual NCL
> script, because this way you can see the description of the example, the
> image, and the link to the script. A good example to start with is
> "coneff_3.ncl":
>
> http://www.ncl.ucar.edu/Applications/coneff.shtml#ex3
>
> which mentions two resources, gsnContourNegLineDashPattern and
> gsnContourPosLineDashPattern
>
> http://www.ncl.ucar.edu/Document/Graphics/Resources/gsn.shtml#
> gsnContourNegLineDashPattern
> http://www.ncl.ucar.edu/Document/Graphics/Resources/gsn.shtml#
> gsnContourPosLineDashPattern
>
> which should hopefully answer your first question.
>
> To answer your second question, you can also use the "tips" page, but this
> time search for "dot" or "stipple". In this case, "dot" gives you the best
> results, and "coneff_11.ncl" may be the best example to look into.  The
> resources cnFillScaleF and cnFillDotSizeF may help you with the density and
> size of your dots.
>
> http://www.ncl.ucar.edu/Applications/coneff.shtml#ex
> <http://www.ncl.ucar.edu/Applications/coneff.shtml#ex11>11
>
> If this doesn't help, please post back to ncl-talk.
>
> Thanks,
>
> --Mary
>
>
> On Thu, Aug 16, 2018 at 8:02 AM, 刘振 <286909655 at qq.com> wrote:
>
>> Dear Sir/Madam,
>>
>>   I use the script attached to plot the significance area (student's t
>> test) with contour lines. I am wondering if there is a way to make the
>> positive area (shading) in solid line while negative area in dash line. The
>> output is also attached. Thanks.
>>   For another output named T2-CTLF-CTL-sum.pdf, most of the area are at
>> 95% significant. By contrast, only region not significant show with
>> contours. Could you also tell me how to deal with such kind of situation. I
>> try to use dot instead of contour to show significant area. But all the
>> plot become black because of the data at a high resolution. Here comes the
>> question that how to decrease the density of the dots? Thanks.
>>
>> Best regards,
>> zhen
>>
>> ------------------
>> 刘振
>> 中山大学
>> 环境科学与工程学院
>> 大气科学系
>> Phone: +86-15013246049
>> 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/20180817/e08a96bd/attachment.html>


More information about the ncl-talk mailing list