[ncl-talk] attaching polymarkers to an XY plot

Rick Brownrigg brownrig at ucar.edu
Wed Nov 18 09:57:58 MST 2015


I can well imagine this script doesn't work for you.  What exactly are you
trying to do?  Based on the example you cited, are you after 11 columns of
markers -- one for each year -- where each column contains 365 markers
denoting ozone measurements?

If you are able to share your data, I can maybe help you get closer to what
you want.  If too big to email, then it can be uploaded via ftp:

ftp ftp.cgd.ucar.edu
anonymous
<use your email address for the password>
cd incoming
put ...
put ...
.
.
.
quit

Note that for security reasons, you cannot list the contents of this
directory, and neither can we. We need to know the *exact* names of the
files in order to retrieve them.


On Wed, Nov 18, 2015 at 9:13 AM, Xi Chang <xi.chang01 at gmail.com> wrote:

> Dear NCL,
>
> I have ozone data with array dimension O3[obs,value], where obs is year of
> observation from 2000-2010 and each year has 365 ozone data, i.e.,
> O3[11x365].
> I'd like to create scatter plot like in example example 29 here
> http://ncl.ucar.edu/Applications/Scripts/xy_29.ncl . However it always
> produced errors and failed since that example is very difficult to adjust
> for my case.
>
> I made something like this for plotting, but it is failed. could you help
> me to figure this out:
>
> ;========
>
>   wks  = gsn_open_wks("x11","xy")
>   gsn_define_colormap(wks,"default")
>
>   res = True
>   res at gsnMaximize    = True
>   res at vpHeightF      = 0.5
>   res at vpWidthF       = 0.75
>   res at vpXF           = 0.15
>   res at tiXAxisString  = "x"
>   res at tiYAxisString  = "y"
>   res at tiMainString   = "sos"
>   res at gsnDraw        = False
>   res at gsnFrame       = False
>   res at xyMarkLineMode = "markers"
>   res at xyMarker       = 16
>   res at xyMarkerColor  = "Background"
>
>
>   year=ispan(2000,2010,1)
>   ntim=dimsizes(year)
>
>   res at trXMinF = year(0)-1
>   res at trXMaxF = year(ntim-1)+1
>
> ;=======
>
> do n=0,364
>
>   plot               = gsn_csm_xy (wks,year,O3(n,:),res) ; create plot
> frame ork
>
> do i=0,ntim-1
>     xmarker = year(i)
>     ymarker = y(i)
>
>     if (i.gt.0) then
>       if (year(i).gt.OldYear) then
>         MarkerCol = MarkerCol+1
>       end if
>       OldYear = year(i)
>     end if
>
>     gsres at gsMarkerColor = MarkerCol
>     gsres at gsMarkerIndex = 16
>
>     plot@$unique_string("dum")$ =
> gsn_add_polymarker(wks,plot,xmarker,ymarker,gsres)
>   end do
>
>   draw(plot)
>   frame(wks)
>
> end do
> end
>
> _______________________________________________
> 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/20151118/a132b56e/attachment.html 


More information about the ncl-talk mailing list