Re: Save script to data table Without Opening GraphYou want to use the Invisible option on the Graph Builder statement, and also to close the invisible object at the end.
a = Expr(
new_graph = Graph Builder(
invisible,
Size( 1000, 800 ),
Show Control Panel( 0 ),
Variables( X( :variable1 ), Y( :variable1 ) )
);
a << Save script to data table( "name_of_graph_script" );
new_graph << close window;
)
Save script to data table Without Opening GraphI've written a script that loops and generates graphs from a table based on conditions. I want to save each of those graphs to the table as a script so that if I needed to view that data I can go back to it. When I use the function "<
A boiled down version of the script save looks like this...
a = Expr(
new_graph = Graph Builder(
Size( 1000, 800 ),
Show Control Panel( 0 ),
Variables( X( :variable1 ), Y( :variable1 ) )
)
);
a << Save script to data table( "name_of_graph_script" );
**I've also tried the last line as the following but the graph still appears after running this...
a << Save script to data table( "name_of_graph_script", <<PROMPT></PROMPT>
ScriptingRe: Save script to data table Without Opening GraphThe New Script command may be helpful to you as well, e.g.
Data Table( "my table" ) << New Script(
"name_of_graph_script",
new_graph = Graph Builder(
Size( 1000, 800 ),
Show Control Panel( 0 ),
Variables( X( :variable1 ), Y( :variable2 ) )
)
);Re: Save script to data table Without Opening GraphExpanding this a bit to apply it to multiple columns:
Names default to here(1);
dt = Open("$Sample_Data/Semiconductor Capability.jmp");
AddGraphScript = function( {dt, v1, v2},
Eval( Eval Expr(
dt << New Script(
"Graph: " || ( v1 << Get Name) || " v " || (v2 << Get Name);
,
new_graph = Graph Builder(
Size( 1000, 800 ),
Show Control Panel( 0 ),
Variables( X( Expr( Name Expr( v1 ) ) ), Y( Expr( Name Expr( v2 ) ) ) )
);
)
) )
);
//for a single graph
AddGraphScript(dt, Expr( :NPN1 ), Expr( :PNP3) );
//for a selected columns
dt << Select Columns( {:PNP3, :IVP1, :PNP4} );
cols = dt << Get Selected Columns();
for( c = 1, c <= n items( cols ), c++, AddGraphScript( dt, Expr( :PNP2 ), cols[c] ) );