[ncl-talk] Plotting markers with different colors

G.Monte at isac.cnr.it G.Monte at isac.cnr.it
Wed Oct 7 04:25:02 MDT 2020


I just solved my problem by geolocating each value in the array at a given
lat-lon, then setting:

res at gsnCoordsAttach = True

It finally worked.

Thanks again,
Giulio


> Ciao Giulio,
> I had to make a plot very similar to yours, and I found this example
> (https://www.ncl.ucar.edu/Applications/Scripts/scatter_7.ncl). Basically,
> you must create an array with the values to be plotted, and then use the
> function transpose
> (https://www.ncl.ucar.edu/Document/Functions/Contributed/transpose.shtml)
> to draw the plot.
> Hope this helps,Giorgio
>
>   ----Messaggio originale----
>
> Da: ncl-talk at mailman.ucar.edu
>
> Data: 6-ott-2020 18.34
>
> A: <ncl-talk at ucar.edu>
>
> Ogg: [ncl-talk] Plotting markers with different colors
>
>
>
> Dears all,
>
> in a script of mine I have a 1-dimensional array like this:
>
>
>
> a=(/1,2,3,1,2,3,3,2,1/)
>
>
>
> I would like to plot its value as some markers having different colors
>
> (for exemple, value 1 in blue, 2 in green and 3 in red).
>
> I have already tried to plot them with "gsn_coordinates" procedure, by
>
> setting:
>
>
>
> 1) a1=where(a.eq.1,a,a at _FillValue)
>
> res at gsMarkerColor = "blue"
>
> gsn_coordinates(wks,map,a1,res)
>
> 2) a2=where(a.eq.2,a,a at _FillValue)
>
> res at gsMarkerColor = "green"
>
> gsn_coordinates(wks,map,a2,res)
>
> 3)  a3=where(a.eq.3,a,a at _FillValue)
>
> res at gsMarkerColor = "red"
>
> gsn_coordinates(wks,map,a3,res)
>
>
>
> I eventually got three different plots: the first for a1, the second for
>
> a2 and the third for a3.
>
> I really want these images to be plotted on the same map; how can I
> proceed?
>
>
>
> Thanks,
>
> Giulio
>
>
>
> _______________________________________________
>
> ncl-talk mailing list
>
> ncl-talk at mailman.ucar.edu
>
> List instructions, subscriber options, unsubscribe:
>
>
>  https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
>
>
>




More information about the ncl-talk mailing list