Re: scatter plots

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 12 2011 - 12:52:33 MST

Hi James,

Hopefully this will clear things up: NCL assumes that you always want the same color (the foregound color, which is color index 1 in your color table) and style (line) when you draw XY plots. Hence, it gives you black lines for XY plots. (Unless black is not your foeground color.) If you pass an multi-dimensional array to gsn_csm_xy, by default you will get black lines, although the lines will be dashed after the first line is drawn.

The only time you need to use the "s" resources is if you want your multiple curves to have different colors and/or styles.

For example, if you want all of your curves to be markers instead of lines, you just need to set:

    res@xyMarkLineMode = "Marker"

If you want these markers to be a different color for each set of curves you have, you need to set:

  res@xyMonoMarkerColor = False ; tells NCL you will be assigning multiple colors
  res@xyMarkerColors = (/array of color indexes or named colors/)

If you want these markers to be something other than the default asterisk, set:

  res@xyMonoMarker = False
  res@xyMarkers = (/array of marker indexes/)

If you want to use more than just the default 16 markers that are available, use NhlNewMarker to add markers to the existing marker table, and then you can use these new indexes when you set xyMarkers.

If the array you're passing to gsn_csm_xy is dimensioned "ncurves x npts", then the xyMarkers and xyMarkerColors should be set to an array of "ncurves" elements, which means that each group of "npts" will get their own marker color and style.

For an example using xyMarkers and xyMarkerColors, see example 2 at:

http://www.ncl.ucar.edu/Applications/xy.shtml#ex2

For an example of NhlNewMarker, see example 4 on the same page.

--Mary

On Jan 12, 2011, at 9:43 AM, James Correia wrote:

> Hi-
> I am working on scatter plots using gsn_csm_xy and my question is on how to use the correct resources for what I want to do.
> I am plotting two 2 dimensional arrays (model,times). I noticed that there are two sets of resources for xyMarker and xyMarkers.
> But I am confused as to how to use them if I want to plot:
> 1. all models at an individual time, or
> 2. all the data
>
> In the case of 1: How do I define my resources such that I can group like models together using one color but use different markers for each model? I have 19 models, but I think there are 17 unique marker style, so we can just use the 17 for an example.
>
> In the case of 2: I think I did this correctly by setting xyMarkLineMode = "Markers" and xyMarkLineModes = "Markers", while supplying xyMarkers with 19 values and xyMarkerColors with 19 values.
>
> So, I am just confused on when to use the resources ending in "s" and when not to to set the correct resources.
>
> --
> ------------------------------------------------------------------------------------------
> The views expressed in this email do not necessarily reflect those of NOAA, the National Weather Service, or the University of Oklahoma.
> ------------------------------------------------------------------------------------------
> James Correia Jr.
> OU CIMMS Research Associate
> SPC HWT Liaison
>
> _______________________________________________
> 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 Wed Jan 12 12:52:38 2011

This archive was generated by hypermail 2.1.8 : Thu Jan 13 2011 - 09:24:20 MST