[ncl-talk] Plotting markers with different colors

Giorgio Graffino g.graffino at tim.it
Wed Oct 7 03:59:44 MDT 2020


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
 

 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201007/4c8a5210/attachment.html>


More information about the ncl-talk mailing list