[ncl-talk] add color dots to map

Adam Phillips asphilli at ucar.edu
Thu Mar 5 16:24:37 MST 2015


Hi Yun,
It looks to me like you are passing all your polymarker coordinates into
each gsn_add_polymarker call and thus coloring them all at once. This would
result in all polymarkers getting colored one color based on your last
pmvalue index value.

Try changing this:
dum = gsn_add_polymarker(wks, plot, x, y, res_poly)
to this:
dum = gsn_add_polymarker(wks, plot, x(i), y(i), res_poly)

If that doesn't work let ncl-talk know.
Adam


On Thu, Mar 5, 2015 at 3:53 PM, Yun Yue <yunyue at huskers.unl.edu> wrote:

>
>  Hi NCL users,
>
> I'm trying to plot observation data to model simulated data map. I think I
> should use gsn_add_polymarker to overlay them. But for the @gsMarkerColor,
> I want use the same color for plotting simulated data map, so I tried to
> use code like the following. But I got black dots on the map. Can somebody
> help me to solve this? Thank you very much.
>
> Yun
>
> wks = gsn_open_wks("x11", "overlay")
>
> gsn_define_colormap(wks,"WhAqGrYeOrReVi200")
>
> cmap      = gsn_retrieve_colormap(wks)
>
> cnLevels = (/5,10,15,20,25,30/)
>
> res_poly = True
>
> res_poly at gsMarkerIndex = 16
>
> res_poly at gsMarkerSizeF = 10
>
> do i = 0, station_numb
>
> res_poly at gsMarkerColor = GetFillColor(cnLevels, cmap, pmvalue(i))
>   dum = gsn_add_polymarker(wks, plot, x, y, res_poly)
>  str1  = unique_string("dum")
> plot@$str1$=dum
> end do
> draw (plot)
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Division, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150305/2e7db587/attachment.html 


More information about the ncl-talk mailing list