<?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: How to add reference lines automatically to variability charts? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14680#M13680</link>
    <description>&lt;P&gt;You can get your limits into a list, then use a variation of code snippet here to add reference lines. Note that there are two ways to do it via script that I know of. One is to set the column property (limit of 4 lines, stays with table and resulting plots), one is to the output, no limitation i know of, but does not get store to table for later use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can copy / paste to a script window and run it. Of course you'd need to loop through the parameters to fully automate to your needs.&lt;/P&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log();
Names Default To Here( 1 );
 
 
dtData = open( "$SAMPLE_DATA\Variability Data\2 Factors Crossed.jmp");
 
 
// 1. add ref lines to the column property.  It will be there for other plots as well.
// this first attempt doesn't work...
//column(dtData, "Measurement")&amp;lt;&amp;lt;set property("Axis", {add reference line(0.4), add reference line(1.2)});
 
// ... but this does.  However, this column property appears to have a limit of four reference lines.
myAxis=expr(:Measurement&amp;lt;&amp;lt;set property("Axis", {Add Ref Line(aaa),Add Ref Line(bbb)}));
eval(substitute(nameexpr(myAxis), expr(aaa), 0.4, expr(bbb), 1.2));
 
      //:mass &amp;lt;&amp;lt; set property("Spec Limits", {65, 125});
 
 
// create the chart, store a referecne to it.
      varChartObj = Variability Chart(
            Y( :Measurement),
            X( {:Operator, :part#} ),
            Max Iter( 100 ),
            Conv Limit( 0.00000001 ),
            Number Integration Abscissas( 128 ),
            Number Function Evals( 65536 ),
            Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),
            Show Range Bars( 0 ),
            Connect Cell Means( 1 ),
            Std Dev Chart( 0 ),
            Points Jittered( 1 ),
            Show Box Plot Whisker Bars( 0 )
      );
 
// 2. The second way to do it is to add the reference lines after creating the plot. I don't know if there is a limit. I've used up to 10.
      report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt; add ref line (0.3, solid, red);
      report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt; add ref line (1.3, solid, red);
     
      // without these, the ref lines would be out of view. You could also get the min  / max of the window, and set the new min / max of the window based off min min and max max.  I typically make the window's scale about 10% bigger than the min / max points of interest.
      report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt;  min(0.2);
      report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt;  max(1.4);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2017 09:49:25 GMT</pubDate>
    <dc:creator>mikedriscoll</dc:creator>
    <dc:date>2017-08-31T09:49:25Z</dc:date>
    <item>
      <title>How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14679#M13679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to make many graphs such as the one below and add limits using the reference limits in the axis settings. The limits are different for each graph. Is there a way to automate this so I do not have to manually add to each graph? The upper and lower limits could be included in the data set in extra columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10155_pastedImage_0.png" style="width: 744px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2283i6CB938E076352585/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10155_pastedImage_0.png" alt="10155_pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 00:52:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14679#M13679</guid>
      <dc:creator>fg6mrw</dc:creator>
      <dc:date>2016-10-19T00:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14680#M13680</link>
      <description>&lt;P&gt;You can get your limits into a list, then use a variation of code snippet here to add reference lines. Note that there are two ways to do it via script that I know of. One is to set the column property (limit of 4 lines, stays with table and resulting plots), one is to the output, no limitation i know of, but does not get store to table for later use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can copy / paste to a script window and run it. Of course you'd need to loop through the parameters to fully automate to your needs.&lt;/P&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log();
Names Default To Here( 1 );
 
 
dtData = open( "$SAMPLE_DATA\Variability Data\2 Factors Crossed.jmp");
 
 
// 1. add ref lines to the column property.  It will be there for other plots as well.
// this first attempt doesn't work...
//column(dtData, "Measurement")&amp;lt;&amp;lt;set property("Axis", {add reference line(0.4), add reference line(1.2)});
 
// ... but this does.  However, this column property appears to have a limit of four reference lines.
myAxis=expr(:Measurement&amp;lt;&amp;lt;set property("Axis", {Add Ref Line(aaa),Add Ref Line(bbb)}));
eval(substitute(nameexpr(myAxis), expr(aaa), 0.4, expr(bbb), 1.2));
 
      //:mass &amp;lt;&amp;lt; set property("Spec Limits", {65, 125});
 
 
// create the chart, store a referecne to it.
      varChartObj = Variability Chart(
            Y( :Measurement),
            X( {:Operator, :part#} ),
            Max Iter( 100 ),
            Conv Limit( 0.00000001 ),
            Number Integration Abscissas( 128 ),
            Number Function Evals( 65536 ),
            Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),
            Show Range Bars( 0 ),
            Connect Cell Means( 1 ),
            Std Dev Chart( 0 ),
            Points Jittered( 1 ),
            Show Box Plot Whisker Bars( 0 )
      );
 
// 2. The second way to do it is to add the reference lines after creating the plot. I don't know if there is a limit. I've used up to 10.
      report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt; add ref line (0.3, solid, red);
      report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt; add ref line (1.3, solid, red);
     
      // without these, the ref lines would be out of view. You could also get the min  / max of the window, and set the new min / max of the window based off min min and max max.  I typically make the window's scale about 10% bigger than the min / max points of interest.
      report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt;  min(0.2);
      report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt;  max(1.4);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 09:49:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14680#M13680</guid>
      <dc:creator>mikedriscoll</dc:creator>
      <dc:date>2017-08-31T09:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14681#M13681</link>
      <description>&lt;P&gt;Or you can use the column property "Spec Limits".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Column 1&amp;lt;&amp;lt;set property("Spec Limits",{LSL( 7 ), USL( 30 ), Target( . ),    Show Limits( 1 )});&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After you set the LSL and USL for a given column, all charts will show the reference lines.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 09:51:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14681#M13681</guid>
      <dc:creator>jara95</dc:creator>
      <dc:date>2017-08-31T09:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14682#M13682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"There are a million ways to get things done..." Talking Heads&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll answer your question with some questions of my own:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Is this something you will do once, or many times over and over?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If many, do the limits change over time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If many, will you alone run the script, or will others?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the answers to these, I might seriously consider using an iterative loop with Associative Arrays from a look-up table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 16:19:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14682#M13682</guid>
      <dc:creator>Kevin_Anderson</dc:creator>
      <dc:date>2015-10-08T16:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14683#M13683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, I am not familiar with running scripts in JMP. I am willing to learn though but will require some other training.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For these graphs, the limits for each particular dataset will not change. I will do this fairly frequently and there will be multiple columns of data with each column having different limits. The dataset has at least a few hundred columns of data but I only need to graph maybe 20 of the columns. Only these 20 columns would therefore need spec limits (reference lines) added to the graphs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 17:00:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14683#M13683</guid>
      <dc:creator>fg6mrw</dc:creator>
      <dc:date>2015-10-08T17:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14684#M13684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added the spec limits to the column properties per below but the charts are not showing the reference lines when I re-plot. Am I doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10162_pastedImage_0.png" style="width: 674px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2291i43CF5130BA1BA8C8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10162_pastedImage_0.png" alt="10162_pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10172_pastedImage_1.png" style="width: 957px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2292iEEE4EDB0D1FB75A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10172_pastedImage_1.png" alt="10172_pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 00:53:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14684#M13684</guid>
      <dc:creator>fg6mrw</dc:creator>
      <dc:date>2016-10-19T00:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14685#M13685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the thread about adding ref. line. There is a check box "Show as graph reference lines" at the bottom of the spec limit box if you use JMP 10 or greater.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/thread/44028" target="_blank"&gt;JSL - showing spec limits as graph reference lines&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2016 13:21:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14685#M13685</guid>
      <dc:creator>jara95</dc:creator>
      <dc:date>2016-10-28T13:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14686#M13686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For my version of JMP (11 standard) it has a checkbox to show reference lines at the spec limits.&amp;nbsp; If it is not checked, distribution platform will show limit lines but the variability platform won't. If it is checked then variability gauge platform will show the limits reference lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might be on some other version of JMP in which case you might also want to add reference lines to the column properties in addition to the limits. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 17:37:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14686#M13686</guid>
      <dc:creator>mikedriscoll</dc:creator>
      <dc:date>2015-10-08T17:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14687#M13687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have the spec limit in the table as columns, then you can use overlay plot. But it doesn't provide any statistics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10170_pastedImage_0.png" style="width: 272px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2293iFC194454C70B1A10/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10170_pastedImage_0.png" alt="10170_pastedImage_0.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10171_pastedImage_1.png" style="width: 522px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2294i232B1C0F701680F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10171_pastedImage_1.png" alt="10171_pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10176_pastedImage_3.png" style="width: 510px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2295i33352382C4FDCAB4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10176_pastedImage_3.png" alt="10176_pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 00:53:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14687#M13687</guid>
      <dc:creator>jara95</dc:creator>
      <dc:date>2016-10-19T00:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14688#M13688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an older revision (8) and it does not have that checkbox. I noticed that it adds the limits to the distribution but not to the variability. I will see about getting an upgrade to a recent version.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 22:26:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/14688#M13688</guid>
      <dc:creator>fg6mrw</dc:creator>
      <dc:date>2015-10-08T22:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/35995#M21204</link>
      <description>&lt;P&gt;Thank you for this.&lt;/P&gt;
&lt;P&gt;Especially the part below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;eval(substitute(nameexpr(myAxis), expr(aaa), 0.4, expr(bbb), 1.2));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;For some reason this substitution is necessary in jmp 12 but not jmp 11 if variables are used instead of the numbers.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I don't know why this is but I am glad I found this structure in your post.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 09:50:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/35995#M21204</guid>
      <dc:creator>b0bajmp</dc:creator>
      <dc:date>2017-08-31T09:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines automatically to variability charts?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/43094#M24967</link>
      <description>&lt;P&gt;Thanks for this feedback. I used it in the following way since I needed to set many reference lines.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;VarChartObj=Graph builder(..)
M=[1,20,30,....];//many as 20 different values
For (i=1,i&amp;lt;=size matrix M, i++,
report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt; add ref line (M[i], solid, red);
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I noticed that execution is very slow although is only about 20 ref lines. I was wondering if there is a way to pass the Matrix argument to the line below without having to make a For loop (I thought perhaps the problem is the loop). Something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;report(varChartObj)[axisbox(1)]&amp;lt;&amp;lt; add ref line (Matrix, solid, red);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or any other method...thanks in advance for your help!!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 09:50:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-reference-lines-automatically-to-variability-charts/m-p/43094#M24967</guid>
      <dc:creator>Eduardo</dc:creator>
      <dc:date>2017-08-31T09:50:56Z</dc:date>
    </item>
  </channel>
</rss>

