Subscribe Bookmark RSS Feed

Using graph builder to create X grouped data

cchb

Community Trekker

Joined:

Aug 12, 2013

Hola,

With some previous help I created some graphs such as the one below:

4557_Screen shot 2013-11-21 at 15.50.42.png

Graph Script:

Graph Builder(

  Size( 676, 477 ),

  Variables(

  X( :Name( "Leaf age (weeks in log scale)" ) ),

  Y( :Name( "Leaf thickness (mm) average RoC" ) ),

  Group X( :Canopy position, Levels( 2 ), Size( 1 ) ),

  Overlay( :Tree )

  ),

  Elements( Line( X, Y, Legend( 3 ), Row order( 1 ), Summary Statistic( "N" ) ) ),

  SendToReport(

  Dispatch(

  {},

  "Leaf age (weeks in log scale)",

  ScaleBox,

  {Scale( "Log" ), Format( "Best", 9 ), Min( 1.8 ), Max( 110 ), Inc( 1 ),

  Minor Ticks( 8 ), Add Ref Line( 3, Dashed, "Black", "Y3" ),

  Inside Ticks( 1 )}

  ),

  Dispatch(

  {},

  "Leaf thickness (mm) average RoC",

  ScaleBox,

  {Add Ref Line( 0, Solid, "Black" )}

  ),

  Dispatch(

  {},

  "400",

  ScaleBox,

  {Legend Model(

  3,

  Properties(

  0,

  {Line Width( 3 ), Marker( "FilledCircle" ), Fill Color( 0 )}

  ),

  Properties(

  1,

  {Line Color( -16711680 ), Line Width( 3 ),

  Marker( "FilledCircle" ), Fill Color( 0 )}

  ),

  Properties(

  2,

  {Line Color( 73 ), Line Width( 3 ), Marker( "FilledCircle" ),

  Fill Color( 0 )}

  ),

  Properties(

  3,

  {Line Color( 24 ), Line Width( 3 ), Marker( "FilledCircle" ),

  Fill Color( 0 )}

  ),

  Properties(

  4,

  {Line Color( -16738560 ), Line Width( 3 ),

  Marker( "FilledCircle" ), Fill Color( 0 )}

  ),

  Properties(

  5,

  {Line Color( 68 ), Line Width( 3 ), Marker( "FilledCircle" ),

  Fill Color( 0 )}

  ),

  Properties(

  6,

  {Line Color( 14 ), Line Width( 3 ), Marker( "FilledCircle" ),

  Fill Color( 0 )}

  ),

  Properties(

  7,

  {Line Color( 0 ), Line Width( 3 ), Marker( "FilledCircle" ),

  Fill Color( 0 )}

  ),

  Properties(

  8,

  {Line Color( 75 ), Line Width( 3 ), Marker( "FilledCircle" ),

  Fill Color( 0 )}

  ),

  Properties(

  9,

  {Line Color( 1 ), Line Width( 3 ), Marker( "FilledCircle" ),

  Fill Color( 0 )}

  ),

  Properties(

  10,

  {Line Color( 20 ), Line Width( 3 ), Marker( "FilledCircle" ),

  Fill Color( 0 )}

  ),

  Properties(

  11,

  {Line Color( 42 ), Line Width( 3 ), Marker( "FilledCircle" ),

  Fill Color( 0 )}

  )

  )}

  ),

  Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ),

  Dispatch(

  {},

  "Y title",

  TextEditBox,

  {Set Text( "Average RoC - Mean leaf thickness (mm)" )}

  )

  )

);


These graphs are based on leaf data I have for 12 different trees, as you can see from the graph above only 4 of these trees have data for both sun (SU) and shade (SH) canopy positions. Out of those 4 trees, 1 tree actually has 3 canopy positions instead of 2: SU, SH Mid and SH Low. What I would like to do now is:

Keep the SU canopy position (left-side graph) as is but on the SH canopy position (right-side graph) I would like to include the data of the 4 trees with the 3 different canopy positions all together and differentiate between the canopy positions with different line styles.

I would be very grateful for advise on how to modify the script above (or the arrangement/categories of my data?) to get this done. I do not write code myself, but I am familiar with using the 'Graph Builder' scripts to do minor changes.

Many thanks in advance for the help, Cecilia