Re: scatter plot with multiple colored markers

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 28 2013 - 09:28:32 MST

Hi Debasish,

Each element in xyMarkerColors resource applies to a group of markers, and not individual values in a 1D array.
You need to have a 2D array, where the leftmost dimension represents a particular grouping of markers with
one color, and the rightmost dimension is the number of markers.

In your case, you have 6 different colors, so what you really want is a 6 x n array that you pass to gsn_csm_xy.
If you have a different number of markers for each color, then "n" will have to represent the largest possible
number of markers associated with one color.

See the attached sample script.

--Mary

On Feb 27, 2013, at 5:32 PM, debasish@sca.uqam.ca wrote:

> Hi,
>
> I am trying to do a scatter plot of an one dimension array and I would
> like to control the colors of each markers.
>
> I define
> res@xyMarkerColors =
> (/"black","blue","red","green","orange","brown","black","blue","red","green","orange","brown",\
> "black","blue","red","green","orange","brown",\
> "black","blue","red","green","orange","brown","black","blue","red","green","orange","brown",\
> "black","blue","red","green","orange","brown",\
> "black","blue","red","green","orange","brown","black","blue","red","green","orange","brown",\
> "black","blue","red","green","orange","brown"/)
>
> plot = gsn_csm_xy(wks,ispan(1,54,1),x,res) ; x dimension is 54
>
> However it only consider 1st color (black) of the array for all markers.
>
> How do I solve this problem?
>
> with regards
> -Debasish
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Thu Feb 28 09:28:45 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 28 2013 - 14:47:31 MST