expr and evalexpr for Graph Builder gradient limitsI am trying to set up a script that will generate a Graph Builder with gradient min and max equal to to Quantile values of the Column being plotted.
Unfortunately, the expr and evalexpr syntax I am using doesn't work for the matrix in "Scale Values".
I need help.
dt0 = current data table();
param = "Voltage";
colp = dt0:param;
graph_high = Quantile( 0.975, column(dt0, param) << get as matrix() );
graph_low = Quantile( 0.025, column(dt0, param) << get as matrix() );
cmd = expr(
Graph Builder(
Size( 550, 550 ),
Show Control Panel( 0 ),
Variables(
X( :x ),
Y( :y ),
Color( :expr(param) )
),
Elements( Points( X, Y, Legend( 6 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
6,
Properties(
0,
{gradient( {Scale Values( [expr(graph_low) expr(graph_high)] )} )}, // *Need Help Here*
Item ID( expr(param), 1 )
)
)}
)
)
);
);
eval(evalexpr(cmd));Data Exploration and VisualizationMass CustomizationRe: expr und evalexpr für Graph Builder GradientengrenzenIch habe Ihre Daten nicht zu validieren, aber das sollte funktionieren:
dt0 = current data table();
param = "Voltage";
colp = dt0:param;
graph_high = Quantile( 0.975, column(dt0, param) << get as matrix() );
graph_low = Quantile( 0.025, column(dt0, param) << get as matrix() );
val matrix = [](1,0) || graph_low || graph_high;
cmd = expr(
Graph Builder(
Size( 550, 550 ),
Show Control Panel( 0 ),
Variables(
X( :x ),
Y( :y ),
Color( :expr(param) )
),
Elements( Points( X, Y, Legend( 6 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
6,
Properties(
0,
{gradient( {Scale Values( Expr( val matrix ) )} )}, // *Need Help Here*
Item ID( expr(param), 1 )
)
)}
)
)
);
);
eval(evalexpr(cmd));Re: expr und evalexpr für Graph Builder GradientengrenzenDanke vielmals. Das hat funktioniert.
Jetzt, da Sie mir die Idee gegeben haben, eine Matrix mit Variablen zu erstellen und diese Matrix dann in das Graph Builder-Skript einzufügen, habe ich beschlossen, etwas herumzuspielen. Es sieht so aus, als müsste ich Expr() nicht um die "val matrix" herum verwenden.
Ich finde, das funktioniert auch:
dt0 = current data table();
param = "Voltage";
colp = dt0:param;
graph_high = Quantile( 0.975, column(dt0, param) << get as matrix() );
graph_low = Quantile( 0.025, column(dt0, param) << get as matrix() );
val matrix = matrix( {graph_low, graph_high} );
cmd = expr(
Graph Builder(
Size( 550, 550 ),
Show Control Panel( 0 ),
Variables(
X( :x ),
Y( :y ),
Color( :expr(param) )
),
Elements( Points( X, Y, Legend( 6 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
6,
Properties(
0,
{gradient( {Scale Values( val matrix )} )},
Item ID( expr(param), 1 )
)
)}
)
)
);
);
eval(evalexpr(cmd));