Hello,
I'm trying to write a script and run it using journal. The script is supposed to plot different graph builder windows. The issue I'm having is that sometimes when I try to change the axis setting (Min, Max, and Increment), the window gets very small and the axis setting becomes different than the one in the script. Ex:
The interesting thing here is that when I try to use the re-run in a new window option, it produces a graph that actually reflects the script:
When clicking at the red tringle, it shows an option to re-run the plot in a new window
After trial and error, I believe it has something to do with the window size I'm choosing. Playing with the window size fixes the issue sometimes, or sometimes playing with the axis setting fix it too. However, this is a time-consuming process. Could I please get guidance on how to make sure I get the correct window size every time(like a dynamic window size) or a guidance on how to get rid of this issue.
this is a snapshot of the jsl code I'm using:
for( i3 =1, i3 < IDD_COUNT+1, i3++,
Sigma[i3] = Col Std Dev( AS COLUMN(IDD_LIST[i3]) );
median[i3] = Col Median( AS COLUMN(IDD_LIST[i3]) );
gb = New Window( "Capability", hlb = H List Box() );
// define spec limit to show the plot clearly
specLimits = as column(IDD_LIST[i3]) << get property( "Spec Limits" );
usln_value = specLimits["USL"];
lsln_value = specLimits["LSL"];
//define Max, Min ,and Inc variables
Max_ = Max( Add( median[i3], Multiply(10, sigma[i3] ) ) );
Min_ = Min( Subtract( median[i3], Multiply(10 , sigma[i3] ) ) );
Inc_ = (Multiply( 5, sigma[i3] ));
if ( Max_ < usln_value , Max_ = Max( Add( usln_value[i3], Multiply(3, sigma[i3] ) ) ) );
if (Min_ > lsln_value , Min_ = Min( Subtract( lsln_value[i3], Multiply(3 , sigma[i3] ) ) ) );
hlb << append(
gb = Graph Builder(
//window size
Size( 5000, 5000),
Variables(
Y( IDD_LIST[i3] ),
Group X( :Program ) ,
),
Elements(
Histogram( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 46 ),Means and Std Devs( 1 ) ),Smoother( X( 1 ), X( 2 ), X( 3 ), X( 4 ), Y, Legend( 49 ) ),
Caption Box( Y, Legend( 50 ), Summary Statistic( "N" ),Summary Statistic 2( "5 Number Summary" ) )
),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( Show( Char( Name Expr( IDD_LIST[i3] ) ) ); )}
),
Dispatch(
{},
Char( Name Expr( IDD_LIST[i3] ) ),
ScaleBox,
{Format( "Best", 6 ), Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 ) } ), Minor Ticks( 1 ),
Max( Max_ ), Min( Min_ ), Inc( Inc_ )
}
),Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
46,
Properties(
0,
{Line Color( 6 ), Fill Color( 38 )},
Item ID( Char( Name Expr( IDD_LIST[i3] ) ), 1 )
)
)}
),
)
);