<?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 Format multiple life distribution plots in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Format-multiple-life-distribution-plots/m-p/812805#M99370</link>
    <description>&lt;P&gt;Hi all I am trying to format axis scales and apply targets to 4 life distribution plots which JMP shows as output of this code.&lt;/P&gt;&lt;P&gt;myld references to a window which has 4 Life distributions.&lt;/P&gt;&lt;P&gt;I am trying to loop through those 4 life distributions through searching in the title is the window has life distribution.&lt;/P&gt;&lt;P&gt;Then I want to change x and y axis for each of those Weibull plots.&lt;/P&gt;&lt;P&gt;Somehow the code only changes 1st plot and remaining 3 are not changed, likely I am not able to grap the handle for rest of the plots correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help correct this code to achieve what I am trying to do.&lt;/P&gt;&lt;P&gt;Better if the "&lt;CODE class=" language-jsl"&gt;Add Ref Line(2 &lt;/CODE&gt;"&amp;nbsp; can be turned into a variable so I can supply 2 as an argument.&lt;/P&gt;&lt;P&gt;So I can add a different reference line for all 4 plots inside for loop. These values can be stores in a list before running the loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myld = Life Distribution(
	Perspective( Compare Groups ),
	Y( :Voltage ),
	Grouping( :flavor ),
	By( :A, :B, :C, :D),
	Confidence Interval Method( Likelihood ),
	Select Distribution( Distribution, Weibull ),
	Select Scale( Weibull ),
	Tabbed Report( 0 ),
	Show Confidence Area( 0 )

);


report_windows = Get Window List( "myld" );//; &amp;lt;&amp;lt; Get Window Title
report_of_interest = Empty();
For Each( {report_window}, report_windows,
	outline_title = Try( report_window[Outline Box( 1 )] &amp;lt;&amp;lt; get title, "" );
	
	If( Starts With( outline_title, "Life Distribution" ),
		print(outline_title);
		report_of_interest = report_window;

		ref = report_window[Outline Box( 1 )] &amp;lt;&amp;lt; Get Scriptable Object;
		xaxis = Report( ref )[axis box( 2 )];

		xaxis &amp;lt;&amp;lt; Axis Settings(
			Format( "Precision", 6, 2 ),
			Min( 1 ),
			Max( 5 ),
			Inc( 0.01 ),
			Minor Ticks( 1 ),
			Add Ref Line(2, "Dotted", "Black", "", 2 ),
			Label Row( {Major Grid Line Color( "Light Yellow" ), Show Major Grid( 1 )} )
		);
		
		yaxis = Report( ref )[axis box( 1 )];
		yaxis &amp;lt;&amp;lt; Axis Settings(
			Min( 0 ),
			Max( 1 ),
			Inc( 0.1 ),
			Minor Ticks( 0 ),
			Add Ref Line(0.5, "Dotted", "Black", "", 2 )
		);

		
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Nov 2024 23:16:24 GMT</pubDate>
    <dc:creator>rahulsmils</dc:creator>
    <dc:date>2024-11-13T23:16:24Z</dc:date>
    <item>
      <title>Format multiple life distribution plots</title>
      <link>https://community.jmp.com/t5/Discussions/Format-multiple-life-distribution-plots/m-p/812805#M99370</link>
      <description>&lt;P&gt;Hi all I am trying to format axis scales and apply targets to 4 life distribution plots which JMP shows as output of this code.&lt;/P&gt;&lt;P&gt;myld references to a window which has 4 Life distributions.&lt;/P&gt;&lt;P&gt;I am trying to loop through those 4 life distributions through searching in the title is the window has life distribution.&lt;/P&gt;&lt;P&gt;Then I want to change x and y axis for each of those Weibull plots.&lt;/P&gt;&lt;P&gt;Somehow the code only changes 1st plot and remaining 3 are not changed, likely I am not able to grap the handle for rest of the plots correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help correct this code to achieve what I am trying to do.&lt;/P&gt;&lt;P&gt;Better if the "&lt;CODE class=" language-jsl"&gt;Add Ref Line(2 &lt;/CODE&gt;"&amp;nbsp; can be turned into a variable so I can supply 2 as an argument.&lt;/P&gt;&lt;P&gt;So I can add a different reference line for all 4 plots inside for loop. These values can be stores in a list before running the loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myld = Life Distribution(
	Perspective( Compare Groups ),
	Y( :Voltage ),
	Grouping( :flavor ),
	By( :A, :B, :C, :D),
	Confidence Interval Method( Likelihood ),
	Select Distribution( Distribution, Weibull ),
	Select Scale( Weibull ),
	Tabbed Report( 0 ),
	Show Confidence Area( 0 )

);


report_windows = Get Window List( "myld" );//; &amp;lt;&amp;lt; Get Window Title
report_of_interest = Empty();
For Each( {report_window}, report_windows,
	outline_title = Try( report_window[Outline Box( 1 )] &amp;lt;&amp;lt; get title, "" );
	
	If( Starts With( outline_title, "Life Distribution" ),
		print(outline_title);
		report_of_interest = report_window;

		ref = report_window[Outline Box( 1 )] &amp;lt;&amp;lt; Get Scriptable Object;
		xaxis = Report( ref )[axis box( 2 )];

		xaxis &amp;lt;&amp;lt; Axis Settings(
			Format( "Precision", 6, 2 ),
			Min( 1 ),
			Max( 5 ),
			Inc( 0.01 ),
			Minor Ticks( 1 ),
			Add Ref Line(2, "Dotted", "Black", "", 2 ),
			Label Row( {Major Grid Line Color( "Light Yellow" ), Show Major Grid( 1 )} )
		);
		
		yaxis = Report( ref )[axis box( 1 )];
		yaxis &amp;lt;&amp;lt; Axis Settings(
			Min( 0 ),
			Max( 1 ),
			Inc( 0.1 ),
			Minor Ticks( 0 ),
			Add Ref Line(0.5, "Dotted", "Black", "", 2 )
		);

		
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2024 23:16:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Format-multiple-life-distribution-plots/m-p/812805#M99370</guid>
      <dc:creator>rahulsmils</dc:creator>
      <dc:date>2024-11-13T23:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Format multiple life distribution plots</title>
      <link>https://community.jmp.com/t5/Discussions/Format-multiple-life-distribution-plots/m-p/812815#M99371</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;LI-MESSAGE title="List of all Platform objects?" uid="687209" url="https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687209#U687209" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there are many objects with helper key "Life Distribution" - just take the top one.&lt;/P&gt;&lt;P&gt;And from there it's the first FrameBox.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;OBs = (Current Report() &amp;lt;&amp;lt; xpath( "//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]" )) 
For Each({OB}, OBs, 
	xaxis = OB[axis box( 2 )];

		xaxis &amp;lt;&amp;lt; Axis Settings(
			Format( "Precision", 6, 2 ),
			Min( 1 ),
			Max( 5 ),
			Inc( 0.01 ),
			Minor Ticks( 1 ),
			Add Ref Line(2, "Dotted", "Black", "", 2 ),
			Label Row( {Major Grid Line Color( "Light Yellow" ), Show Major Grid( 1 )} )
		);
		
		yaxis = OB[axis box( 1 )];
		yaxis &amp;lt;&amp;lt; Axis Settings(
			Min( 0 ),
			Max( 1 ),
			Inc( 0.1 ),
			Minor Ticks( 0 ),
			Add Ref Line(0.5, "Dotted", "Black", "", 2 )
		);
	
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2024 23:38:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Format-multiple-life-distribution-plots/m-p/812815#M99371</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-11-13T23:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Format multiple life distribution plots</title>
      <link>https://community.jmp.com/t5/Discussions/Format-multiple-life-distribution-plots/m-p/812877#M99374</link>
      <description>&lt;P&gt;Depending on the JMP version you have different options (I go with the assumption of JMP18). When you use By column in your platform, you can get back a list of platforms which you can then loop over (you can get the list also by using XPath). Usually I try to find some very robust OutlineBox and then use that to "tie" the indices.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This isn't exactly the same what you are doing but should give some ideas about what can be done.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Reliability/Fan.jmp");
dt &amp;lt;&amp;lt; New Column("Group", Nominal, Numeric, Formula(Row() &amp;lt;= 35));

lds = dt &amp;lt;&amp;lt; Life Distribution(Y(:Time), Censor(:Censor), By(:Group));

refs = Associative Array();
refs["0"] = 0.2;
refs["1"] = 0.4;

// show(lds);

For Each({ld}, lds,
	rep = Report(ld);
	grouptitle = rep &amp;lt;&amp;lt; get title;
	// show(rep &amp;lt;&amp;lt; get title);
	groupname = Word(-1, grouptitle, "=");

	// Be careful with axis indices as there can be "hidden" axis
	yaxis = rep[Outline Box("Compare Distributions"), AxisBox(1)];
	xaxis = rep[Outline Box("Compare Distributions"), AxisBox(2)];
	
	
	// Two methods shown here
	xaxis &amp;lt;&amp;lt; Min(1000) &amp;lt;&amp;lt; Max(12000) &amp;lt;&amp;lt; Inc(1000) &amp;lt;&amp;lt; Format("Precision", 6, 2) &amp;lt;&amp;lt; Minor Ticks(1) &amp;lt;&amp;lt; Label Row(
		{Major Grid Line Color("Light Yellow"), Show Major Grid(1)}
	);
	
	yaxis &amp;lt;&amp;lt; Axis Settings(
		Format("Precision", 6, 2),
		Min(0),
		Max(1),
		Inc(0.1),
		Minor Ticks(1),
		Add Ref Line(refs[groupname], "Dotted", "Black", "", 2)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1731565898938.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70134i66676A960ACB7246/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1731565898938.png" alt="jthi_1-1731565898938.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 06:32:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Format-multiple-life-distribution-plots/m-p/812877#M99374</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-11-14T06:32:47Z</dc:date>
    </item>
  </channel>
</rss>

