<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I put N of the overlay variable onto a graph? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-put-N-of-the-overlay-variable-onto-a-graph/m-p/243208#M47999</link>
    <description>&lt;P&gt;One of the data visualisations I am routinely producing is a set of X/Y data grouped by categorical variables in two dimensions to produce a square array of plots: see attached example. I further &lt;EM&gt;Overlay&lt;/EM&gt; the X/Y data by an observation ID in order to connect all the data points from one observation with a line (placing another variable into the &lt;EM&gt;Color&lt;/EM&gt; axis in order to keep the resulting plot readable).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cannot guarantee that each of the cells in this array of plots has the same occupancy, for technical reasons. Therefore, the team members using the data that I am creating need to know exactly how many observations (unique values of the observation ID) are present in each cell, because otherwise the visualisation has the potential to mislead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because I am using the &lt;EM&gt;Overlay&lt;/EM&gt; axis, if I use a&amp;nbsp;&lt;EM&gt;Caption Box&lt;/EM&gt; then I get one caption per value of the observation ID: what I have been asked to provide is one caption per cell, counting the number of unique values of observation ID there are in that cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course this can be worked around by manually adding labels into each cell, but this is distinctly laborious. Of course I can provide other visualisations, but my team members have requested&amp;nbsp;this specific visualisation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I overlooking a feature that will do this simply?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21360i1DABE8E2F4D645EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example.jpg" alt="Example.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jan 2020 12:38:03 GMT</pubDate>
    <dc:creator>Ian_Horne</dc:creator>
    <dc:date>2020-01-28T12:38:03Z</dc:date>
    <item>
      <title>How do I put N of the overlay variable onto a graph?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-put-N-of-the-overlay-variable-onto-a-graph/m-p/243208#M47999</link>
      <description>&lt;P&gt;One of the data visualisations I am routinely producing is a set of X/Y data grouped by categorical variables in two dimensions to produce a square array of plots: see attached example. I further &lt;EM&gt;Overlay&lt;/EM&gt; the X/Y data by an observation ID in order to connect all the data points from one observation with a line (placing another variable into the &lt;EM&gt;Color&lt;/EM&gt; axis in order to keep the resulting plot readable).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cannot guarantee that each of the cells in this array of plots has the same occupancy, for technical reasons. Therefore, the team members using the data that I am creating need to know exactly how many observations (unique values of the observation ID) are present in each cell, because otherwise the visualisation has the potential to mislead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because I am using the &lt;EM&gt;Overlay&lt;/EM&gt; axis, if I use a&amp;nbsp;&lt;EM&gt;Caption Box&lt;/EM&gt; then I get one caption per value of the observation ID: what I have been asked to provide is one caption per cell, counting the number of unique values of observation ID there are in that cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course this can be worked around by manually adding labels into each cell, but this is distinctly laborious. Of course I can provide other visualisations, but my team members have requested&amp;nbsp;this specific visualisation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I overlooking a feature that will do this simply?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21360i1DABE8E2F4D645EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example.jpg" alt="Example.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 12:38:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-put-N-of-the-overlay-variable-onto-a-graph/m-p/243208#M47999</guid>
      <dc:creator>Ian_Horne</dc:creator>
      <dc:date>2020-01-28T12:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I put N of the overlay variable onto a graph?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-put-N-of-the-overlay-variable-onto-a-graph/m-p/243225#M48002</link>
      <description>&lt;P&gt;What I believe you will need to do, is to add a customized piece of JSL to your Graph Builder.&amp;nbsp; Each of the individual graphs can be addressed, and a script can be written to add the appropriate N value into each. Below is a very simple example based upon a simpler graph, but it should give you an idea on how to do this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="text.PNG" style="width: 593px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21359i8CF46930FA9742AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="text.PNG" alt="text.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 525, 496 ),
	Show Control Panel( 0 ),
	Variables(
		X( :weight ),
		Y( :height ),
		Group X( :age ),
		Overlay( :sex )
	),
	Elements( Line( X, Y, Legend( 8 ) ) )
);

// Get the counts for each of the ages
Summarize( dt, groupBy = By( :Age ), N = Count( :Age ) );

// Make sure stats are complete before moving on
wait(0);

// Find the upper right corner axis values so one can back off a bit and place
// the values of N in an appropriate place
// Place the values into a list, which is required for the graphic function
// that is to be used
theList = {};
theList[1] = (Report( gb )[AxisBox( 1 )] &amp;lt;&amp;lt; get max) * .85;
theList[2] = (Report( gb )[AxisBox( 2 )] &amp;lt;&amp;lt; get max) * .95;

// Now Place the values
For( i = 1, i &amp;lt;= N Items( n ), i++,
	val = "N=" || Char( n[i] );show(val);
	Report( gb )[FrameBox( i )] &amp;lt;&amp;lt;
	add graphics script( Text( Center Justified, theList, val ) );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jan 2020 11:54:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-put-N-of-the-overlay-variable-onto-a-graph/m-p/243225#M48002</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-28T11:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I put N of the overlay variable onto a graph?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-put-N-of-the-overlay-variable-onto-a-graph/m-p/243229#M48003</link>
      <description>&lt;P&gt;Thank you! There are a couple of JSL commands in there that I hadn't come across before, which I think will be key to my solution.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 11:57:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-put-N-of-the-overlay-variable-onto-a-graph/m-p/243229#M48003</guid>
      <dc:creator>Ian_Horne</dc:creator>
      <dc:date>2020-01-28T11:57:24Z</dc:date>
    </item>
  </channel>
</rss>

