Re: Marker colors in scatter plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 08 2010 - 14:10:35 MDT

The xyMarkerColors resource only works if you have multiple curves.
It's not a way to take points in a single curve and color them
differently.

If you want the first three red and the second three blue, then
create two curves:

x = ispan(1,6,1)
y = new((/2,dimsizes(x)/),float)

y(0,0:2) = x(0:2)+3 ; The rest of y will be missing values
y(1,0:2) = x(3:5)+3

Now set:

res@xyMarkerColors = (/"red","blue"/)

The red will apply to the curve represented by y(0,:), and
blue will apply to y(1,:).

--Mary

On Apr 8, 2010, at 1:50 PM, Jiangfeng Wei wrote:

> Yes, Same results with "xyMarkerColors".
>
>
> On Apr 8, 2010, at 3:39 PM, Rick Brownrigg wrote:
>
>> Hi,
>>
>> Note the distinction between the "xyMarkerColor" versus
>> "xyMarkerColors" resources. I think you want the plural version
>> to get what you want. That said, the docs say it takes an array of
>> ColorIndex, so I'm not certain using named colors will work there.
>>
>> Rick
>>
>> On Apr 8, 2010, at 1:28 PM, Jiangfeng Wei wrote:
>>
>>> Dear all,
>>>
>>> In this short code, I am going to set the first 3 markers in red and
>>> last 3 markers in blue. But they are plotted in red. Any problem
>>> with
>>> the code?
>>>
>>>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>>
>>> begin
>>> wks = gsn_open_wks("x11","scatter")
>>>
>>> res = True ; plot mods
>>> desired
>>> res@xyMarkLineMode = "Markers" ; choose which have markers
>>> res@xyMarkers = 16 ; choose type of
>>> marker
>>> res@xyMarkerColor =
>>> (/"red","red","red","blue","blue","blue"/)
>>>
>>> x = ispan(1,6,1)
>>> y = x+3
>>>
>>> plot = gsn_csm_xy (wks,x,y,res)
>>>
>>> end
>>> ~
>>>
>>>
>>> _______________________________________________
>>> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 8 14:10:44 2010

This archive was generated by hypermail 2.1.8 : Wed Apr 14 2010 - 09:15:22 MDT