Re: Markers and lines on an XY plot

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 24 2010 - 09:46:43 MDT

Hi Emilie,
Yes, I believe that behavior is expected. I understand your point, but I
think it is more logical the way NCL is currently behaving. Do you need
to set the other resources to dimension size 4? It depends:

   res_w@xyMarkLineModes = (/ "Markers", "Markers", "Lines", "Lines" /)

   res_w@xyMarkers = (/ 4, 16 /) ; some dot
   res_w@xyMarkerColors = (/ 3, 30 /)
   res_w@xyMarkerSizes = (/ 0.065, 0.055 /)

The above three resources only need to be set to dimension size 2, as
they really don't apply to xyMarkLineModes(2:3) as you are drawing
lines. If, however, xyMarkLineModes =
(/"Markers","Lines","Lines","Markers"/), then you would want to set
these all of size 4, with entries 1 and 2 being dummy values that NCL
will ignore.

   res_w@xyDashPatterns = (/ 2, 1 /) ; dashed lines

As you saw, this resource needs to be of dimension size 4, as only the
2nd and 3rd entries are applicable to Lines. The 0th and 1st entries
will be ignored by NCL as the 0th and 1st entries of xyMarkLineModes =
"Markers"

   res_w@xyLineThicknessF = thickness
   res_w@xyLineColor = 255

As the above 2 resources are singular and all-inclusive, these apply to
all 4 entries of xyMarkLineModes where applicable. In this case,
xyLineThicknessF only applies to the 2nd/3rd entries of xyMarkLineModes
as they are = Lines, and similarly xyLineColor is only applicable to the
0th/1st entries.

If you wanted to set various line colors/thicknesses, you can set:

   res_w@xyLineThicknesses = (/1.0,1.0,2.5,1.0/)
   res_w@xyLineColors = (/255,253/)
     or
   res_w@xyLineColors = (/255,253,1,1/) ; 1's will be ignored

Hopefully that all makes sense...
Adam

On 09/24/2010 09:29 AM, Emilie Vanvyve wrote:
> Hello,
>
> I have got a resources behaviour I wasn't expecting and cannot figure
> out why it is like that. I wondered whether someone could explain it to me.
>
> I draw a simple XY plot with 4 series of data (let's say A, B, C and D).
> I want A and B drawn with markers only, and C and D as lines only. I
> have set up my resources as:
>
> res_w@xyMarkLineModes = (/ "Markers", "Markers", "Lines", "Lines" /)
> res_w@xyMarkers = (/ 4, 16 /) ; some dots
> res_w@xyMarkerColors = (/ 3, 30 /)
> res_w@xyMarkerSizes = (/ 0.065, 0.055 /)
> res_w@xyDashPatterns = (/ 2, 1 /) ; dashed lines
> res_w@xyLineThicknessF = thickness
> res_w@xyLineColor = 255
>
> With this, A and B are fine but not C and D. Colours and
> sizes/thicknesses are correct for all 4 series, but C and D appear as
> solid lines instead of dashed lines. To get it right, I have to change
> @xyDashPatterns to:
>
> res_w@xyDashPatterns = (/ something, something, 2, 1 /)
>
> Is this normal? @xyMarker* and @xyLine* only seem to need 2 values as I
> would expect from the setting of @xyMarkLineModes. Why then does
> @xyDashPatterns need 4 values? Should I define all these resources as
> arrays of 4 values? (It also works.)
>
> Emilie
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Sep 24 09:46:48 2010

This archive was generated by hypermail 2.1.8 : Mon Oct 04 2010 - 08:55:55 MDT