[ncl-talk] question about drawing a contour plot

Mary Haley haley at ucar.edu
Wed Apr 8 14:18:09 MDT 2015


The problem is NCL doesn't know anything about the edges of your grid, so
it smooths the values between each point.

You might look at the sfXCellBounds and sfYCellBounds resources.  If you
can provide the edges of the polygons that surround each data point, then
you should get a better contour plot.

http://www.ncl.ucar.edu/Document/Graphics/Resources/sf.shtml#sfXCellBounds
http://www.ncl.ucar.edu/Document/Graphics/Resources/sf.shtml#sfYCellBounds

--Mary


On Sun, Mar 29, 2015 at 9:52 AM, jaein song <jaein_song at yonsei.ac.kr> wrote:

> I've been tried using 1-dimensional data with sfXArray and sfYArray.
> and then, the result was like figure below.
> [image: 본문 이미지 1]
> I think, this is a result of automatically interpolated data.
>
> how should I remove those polygons?
> I want that the figure appears like figure of former e-mail with
> coordinate like this figure.
>
> for this script, below was changed.
>
>          do pi=0,np-1                                    ;DO LOOP #4
> PIN->TH
>
>                                 hfp             = mod(pin(pi),nh)
>               ;??? nh? nh-1? not sure if nh and nt start from 0 or 1
>                                 tfp             = (pin(pi)-hfp)/nh
>                                 ;hco(pi)                =h(hfp)
>                                 hco(pi)         = h(hfp)/1000
>                                 tco(pi)         = t(tfp)/86400*24
>                                 ;zup(pin(pi))   = zp(pi)
>                         end do
>
>
>
>   res at sfXArray             = tco
>   res at sfYArray             = hco
>   res at trXMaxF              = 24
>   res at trXMinF              = 0
>   res at trYMaxF              =  15
>   res at trYMinF              =0
>   res at lbOrientation        = "Vertical"
>   res at tiXAxisString        = "time(hour)"
>   res at tiYAxisString        = "height(m)"
>   res at tmXBLabelsOn        = True
>   res at tmYLLabelsOn        = True
>   plot = gsn_csm_contour(wks1,zp,res)
>
>
> 2015-03-30 0:44 GMT+09:00 jaein song <jaein_song at yonsei.ac.kr>:
>
>>
>> Hello, my name is Jaein Song and a graduate student of Yonsei University.
>> I want to draw a figure with irregular coordinate variables of x axis.
>> but it doesn't work well.
>> the figure below is a output of the script (except the red box).
>> the numbers in red box(at x axis) came from array number (if z(n,m)-> m
>> appears)
>> but, I wish that these numbers represent the time (t of included script).
>> I think this problem appears because t is a irregular coordinate
>> variable. but I don't know how should I do.
>>
>> below is information about variable which i want to draw.
>>
>> zup!0="h"
>> zup!1="t"
>> zup&h=h
>> zup&t=t
>>
>>
>> how should I do ?
>>
>>
>>
>> I attach the original data file and the script.
>>
>> [image: 본문 이미지 5]
>>
>> below is the error message (Warning)
>> warning:_NhlCreateSplineCoordApprox: Attempt to create spline
>> approximation for X axis failed: consider adjusting trXTensionF value
>> warning:IrTransInitialize: error creating spline approximation for
>> trXCoordPoints; defaulting to linear
>>
>>
>>
>>
>> --
>> *Jae In Song (Master's course)*
>> Cloud Physics Lab
>> Department of Atmospheric Sciences, Yonsei University.
>>
>> 120-749
>> Science hall #530A, Yonsei-ro 50
>> Seodaemun-gu, Seoul, S.Korea
>>
>> Lab: +82-2-2123-7613
>> Mobile: +82-10-9045-9209
>>
>>
>>
>>
>>
>> --
>> *Jae In Song (Master's course)*
>> Cloud Physics Lab
>> Department of Atmospheric Sciences, Yonsei University.
>>
>> 120-749
>> Science hall #530A, Yonsei-ro 50
>> Seodaemun-gu, Seoul, S.Korea
>>
>> Lab: +82-2-2123-7613
>> Mobile: +82-10-9045-9209
>>
>>
>>
>
>
> --
> *Jae In Song (Master's course)*
> Cloud Physics Lab
> Department of Atmospheric Sciences, Yonsei University.
>
> 120-749
> Science hall #530A, Yonsei-ro 50
> Seodaemun-gu, Seoul, S.Korea
>
> Lab: +82-2-2123-7613
> Mobile: +82-10-9045-9209
>
>
>
> _______________________________________________
> ncl-talk mailing list
> 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/20150408/491cce7d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 158600 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150408/491cce7d/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 121124 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150408/491cce7d/attachment-0001.png 


More information about the ncl-talk mailing list