<?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 Re: Plotting two y variables on same graph with overlay on one in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57106#M32033</link>
    <description>&lt;P&gt;The image you included is exactly what I'm looking for.&amp;nbsp; I'm able to follow along with your instructions until the final point.&amp;nbsp; When I open the variables for the line, I don't see an option for the overlay.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Graph builder 2.PNG" style="width: 943px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10756i71D870A52E436007/image-size/large?v=v2&amp;amp;px=999" role="button" title="Graph builder 2.PNG" alt="Graph builder 2.PNG" /&gt;&lt;/span&gt;I'm working in JMP Pro 13, could that be an issue?&lt;/P&gt;</description>
    <pubDate>Wed, 16 May 2018 19:26:17 GMT</pubDate>
    <dc:creator>crabduchess</dc:creator>
    <dc:date>2018-05-16T19:26:17Z</dc:date>
    <item>
      <title>Plotting two y variables on same graph with overlay on one</title>
      <link>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57098#M32028</link>
      <description>&lt;P&gt;I am trying to create a single graph with two plots.&amp;nbsp; The first is a bar chart of survival across six sites, overlayed with a treatment replicated at each site.&amp;nbsp; The second is a line graph of the average survival at each site across treatment.&amp;nbsp; I can create exactly what I want in graph builder, except that I have to plot the line on a second graph above the bars (attached graph builder image).&amp;nbsp; And I can create exactly what I want with the chart platform, except that I cannot figure out how to overlay the treatment variable for the bars (chart image).&amp;nbsp; I feel like there has to be a fairly obvious way to achieve this that I am missing.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chart.PNG" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10757i3A6D57622D9F38E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chart.PNG" alt="chart.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="graph builder.PNG" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10758iF9A57F7F987EA003/image-size/medium?v=v2&amp;amp;px=400" role="button" title="graph builder.PNG" alt="graph builder.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 19:48:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57098#M32028</guid>
      <dc:creator>crabduchess</dc:creator>
      <dc:date>2018-05-16T19:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting two y variables on same graph with overlay on one</title>
      <link>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57103#M32031</link>
      <description>&lt;P&gt;Here is how I did what I think you want&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="graph builder.PNG" style="width: 959px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10755i1C77C0FBB01E18C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="graph builder.PNG" alt="graph builder.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;1. Drag the x (site_order) and y(daily.survival.rate) columns into the graph.&lt;/P&gt;
&lt;P&gt;2. Drag the Treatment column to the overlay&lt;/P&gt;
&lt;P&gt;3. Click on the graph and select&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Add==&amp;gt;Line&lt;/P&gt;
&lt;P&gt;4. Two lines will appear.&amp;nbsp; One for each Overlay.&amp;nbsp; So what you need to do, is to go to the Properties Area on the left of the graph, and find the Properties for the Line.&amp;nbsp; Go to the Variables area and click on the gray triangle to open up the variables list.&amp;nbsp; Unclick the Overlay for the Treatment variable.&lt;/P&gt;
&lt;P&gt;There will then only be one line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe this does what you want?&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 18:42:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57103#M32031</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-05-16T18:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting two y variables on same graph with overlay on one</title>
      <link>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57106#M32033</link>
      <description>&lt;P&gt;The image you included is exactly what I'm looking for.&amp;nbsp; I'm able to follow along with your instructions until the final point.&amp;nbsp; When I open the variables for the line, I don't see an option for the overlay.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Graph builder 2.PNG" style="width: 943px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10756i71D870A52E436007/image-size/large?v=v2&amp;amp;px=999" role="button" title="Graph builder 2.PNG" alt="Graph builder 2.PNG" /&gt;&lt;/span&gt;I'm working in JMP Pro 13, could that be an issue?&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 19:26:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57106#M32033</guid>
      <dc:creator>crabduchess</dc:creator>
      <dc:date>2018-05-16T19:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting two y variables on same graph with overlay on one</title>
      <link>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57114#M32036</link>
      <description>&lt;P&gt;You are correct, the last step in my list of instructions requires JMP 14.&amp;nbsp; However, the script below shows how to add the line you want using a Graphics Script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

// Create the Graph
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Variables( X( :age ), Y( :height ), Overlay( :sex ) ),
	Elements( Bar( X, Y, Legend( 6 ) ) )
);

// Create a pointer to the framebox() in the graph
rgb = Report( gb )[FrameBox( 1 )];

// Calculate the means for each age
Summarize( byAge = by( :Age ), theMeans = Mean( :Height ) );

// Because the X axis is not a continuous scale, the values
// for each position on the X axis start with 0 and is increased
// by 1 for each group
// Create the matrix of X axis values
ageMat = Index( 0, N Items( byAge ) - 1 );

// Add the graphic commands to draw a line on the graph
rgb &amp;lt;&amp;lt; add graphics script(
	Pen Color( "green" );
	Pen Size( 3 );
	Line( ageMat, theMeans );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 May 2018 21:20:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57114#M32036</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-05-16T21:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting two y variables on same graph with overlay on one</title>
      <link>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57143#M32059</link>
      <description>&lt;P&gt;I think I've correctly updated your script to reference my data, but this is my first foray into scripting in JMP (and I've had a fair amount of training in R from a scientific perspective, but I'm far from computer science literate).&amp;nbsp; I can produce the bar graph from the script but I'm not sure how to call the code for line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table(DataFromKimbroSurvival);

// Create the Graph
gb = dt &amp;lt;&amp;lt; Graph Builder(
    Variables( X( :site.order ), Y( :daily.survival.rate ), Overlay( :treatment ) ),
    Elements( Bar( X, Y, Legend( 6 ) ) ),
);

rgb = Report( gb )[FrameBox( 1 )];

Summarize( bySite = by( :site.order ), theMeans = Mean( :daily.survival.rate ) );

siteMat = Index( 0, N Items( bySite ) - 1 );

rgb &amp;lt;&amp;lt; add graphics script(
    Pen Color( "green" );
    Pen Size( 3 );
    Line( siteMat, theMeans );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 May 2018 18:10:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57143#M32059</guid>
      <dc:creator>crabduchess</dc:creator>
      <dc:date>2018-05-17T18:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting two y variables on same graph with overlay on one</title>
      <link>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57157#M32066</link>
      <description>&lt;P&gt;If you run the script, the chart, and the "add graphics script" will run.&amp;nbsp; If you are not getting a line drawn on the chart, I assume that there may be an issue with matching the x values for the line, with what the x values for the chart are.&amp;nbsp; Please go to the x axis on the chart, and right click on it and open the axis settings.&amp;nbsp; The assumption in my code, is that the x axis values have a minimum value of around zero, and the max a value about equal to the number groupings of your column :treatment.&lt;/P&gt;
&lt;P&gt;If that is not the case, then reply back with the min and max axis values.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 19:51:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57157#M32066</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-05-17T19:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting two y variables on same graph with overlay on one</title>
      <link>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57374#M32098</link>
      <description>&lt;P&gt;The values run from 0 to 5, so if I'm understanding you correctly, there shouldn't be an issue, correct?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="axis settings.PNG" style="width: 733px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10778i0B9FBBED9D27FA0C/image-size/large?v=v2&amp;amp;px=999" role="button" title="axis settings.PNG" alt="axis settings.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2018 15:02:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57374#M32098</guid>
      <dc:creator>crabduchess</dc:creator>
      <dc:date>2018-05-18T15:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting two y variables on same graph with overlay on one</title>
      <link>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57376#M32099</link>
      <description>&lt;P&gt;You are correct.&amp;nbsp; So are there any errors in the log?&amp;nbsp; You may want the use the show() function to list out the matricies that are created, to validate they are correct.&lt;/P&gt;
&lt;P&gt;Can you attach a sample data table, and then I could take a better look at the issue?&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2018 15:18:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plotting-two-y-variables-on-same-graph-with-overlay-on-one/m-p/57376#M32099</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-05-18T15:18:24Z</dc:date>
    </item>
  </channel>
</rss>

