[ncl-talk] scatter plot w/ different markers

Adam Phillips asphilli at ucar.edu
Mon Feb 3 16:46:10 MST 2020


Hi Alessandra,
Thanks for sending an easy-to-run example of the issue you are facing. I
replied to a similar query this past September:
http://mailman.ucar.edu/pipermail/ncl-talk/2019-September/015579.html

In short, you have to create 2D arrays of the input x/y axis values, as
xyMarkers will assign a different marker for an array dimensioned (M,N) for
every index N. Using your example, the following modifications result in
the desired marker changes:
mkres = True
mkres at xyMarkLineMode   = "Markers"
mkres at xyMarkerSizeF     = 0.02           ; Marker size (default 0.01)
mkres at xyMarkers = ispan(2,11,1)
mkres at xyMonoMarker = False

tind2 = new((/dimsizes(tind),2/),typeof(tind))
tind2(:,0) = (/ tind /)
pind2 = new((/dimsizes(pind),2/),typeof(pind))
pind2(:,0) = (/ pind /)

oplots = gsn_csm_xy(wks,pind2,tind2,mkres)

Hope that helps!
Adam


On Mon, Feb 3, 2020 at 1:41 PM Alessandra Giannini via ncl-talk <
ncl-talk at ucar.edu> wrote:

>
> hello everyone,
>
> I have a problem that has been nagging me for a while…
> Here it is in its simplified form —
> I would like to make a scatter plot of two variables, with each point in
> the plot represented by a different marker, selected from this list of
> possible markers:
> <http://www.ncl.ucar.edu/Document/Graphics/Images/markers.png>
>
> These are the plot resources I set:
>
> mkres = True
> mkres at gsnDraw  = False                          ; need these to wait
> mkres at gsnFrame = False
>
> mkres at xyMarkLineMode   = "Markers"
> mkres at xyMarkerSizeF     = 0.01           ; Marker size (default 0.01)
> mkres at xyMarkers = ispan(2,16,1)
>
> following various examples in plot types/scatter plots.
>
> But instead of the expected different markers, I get the same marker,
> corresponding to the first value in “ispan(2,16,1)", for all points.
> Is there some "sticky” default resource that needs to be unset?
>
> I am running NCL version 6.3.0
>
> Attached are the entire script, and a sample output.
>
> Your help is much appreciated —
>
> warm regards, alessandra
>
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk



-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, 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/20200203/d18e3bcd/attachment.html>


More information about the ncl-talk mailing list