Aggiungi la riga di riferimento dalla tabella di riferimentoCIAO, @txnelson
Sto cercando di creare un grafico della trama della variabilità e aggiungere linee di riferimento con valori diversi per ciascuno dei singoli grafici. Attualmente posso tracciare la linea di riferimento ma il problema è che se la tabella di riferimento non contiene tutte le colonne di test dalla tabella dati, lo script non funzionerà.
Ecco cosa ho provato e funziona se la tabella di riferimento ha tutti i test dalla tabella dati:
Names Default To Here( 1 );
Clear Globals();
dt = Open("Data table.jmp"); // Open data table
// Loop to get column name Currents and Voltages
colist = {};
Col_List = dt << Get Column Names( "String" );
For( q = 1, q <= N Items( Col_List ), q++,
If( Contains( Col_List[q], "Current" ) | Contains( Col_List[q], "Voltage" ),
Column( Col_List[q] ) << Set Selected( 1 );
Insert Into( colist, Col_List[q] );
)
);
// Var Chart
vc= dt << Variability Chart(
Y( (Eval( colist )) ),
X( :Wafer ID ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Show Range Bars( 0 ),
Std Dev Chart( 0 ),
Points Jittered( 1 )
);<BR />// Reference data table
dt1 = Open ("Reference table.jmp");
xb = Column(dt1, "Reference") << getValues;
// Loop to add reference line to the variability chart
For( i = 1, i <= N Items( vc ), i++,
Report( vc[i] )[Framebox( 1 )] << DispatchSeg( CustomStreamSeg( 3 ), {Line Width( 2 )} );
Report( vc[i] )[AxisBox( 1 )] << {Add Ref Line( xb[i], "Solid", "Green", "RTS", 2 )};
);Personalizzazione di massaRe: Aggiungi riga di riferimento dalla tabella di riferimentoCi sono un paio di problemi.
- Piattaforme diverse hanno strutture ad albero diverse perché hanno strutture di output diverse.Pertanto la mappatura ai diversi oggetti all'interno dell'output è diversa.
- Si specifica dt come puntatore alla "Tabella dati", ma più avanti nello script si tenta di eseguire l'Overlay Plot, puntando a una tabella dati a cui fa riferimento una variabile dt2, che non esiste nel codice.
- Nel tuo codice che crea l'array associativo, usi una variabile dalla tua tabella di dati di riferimento, chiamata Reference.Nei dati di esempio che hai fornito nella discussione su Optimize Loop, la variabile in quella tabella di dati è chiamata Mean.
Di seguito è riportata una modifica del codice che produce il seguente output

Names Default To Here(1);
// dt = Open("Data table.jmp"); // Open data table
dt=data table("Data Table");
// dt1 = Open("Reference table.jmp");
dt1=data table("Reference data table");
// Loop to get column name Currents and Voltages
colist = {};
Col_List = dt << Get Column Names("String");
For(q = 1, q <= N Items(Col_List), q++,
If(Contains(Col_List[q], "Current") | Contains(Col_List[q], "Voltage"),
Column(Col_List[q]) << Set Selected(1);
Insert Into(colist, Col_List[q]);
)
);
// Overlay Plot
vc = dt << Overlay Plot( Y( Eval( colist ) ), No Overlay( 1 ),Ungroup Plots( 1 ) );
aa_refs = Associative Array(dt1:Tests << get values, dt1:mean << get values);
// Loop to add reference line to the variability chart
For(i = 14, i <= N Items(colist), i++,
If(Contains(aa_refs, colist[i]),
Report(vc)[AxisBox(1)] << Add Ref Line(aa_refs[colist[i]], "Solid", "Green", "RTS", 2);
);
);
Si prega di dedicare del tempo alla lettura degli alberi di visualizzazione nella Guida allo scripting, disponibile nella Libreria della documentazione di JMP, nel menu a discesa della Guida.
Re: Aggiungi riga di riferimento dalla tabella di riferimentoCIAO @jthi ,
Ho stanco il tuo codice sui grafici sovrapposti ma sembra esserci un errore. Eventuali suggerimenti?
Names Default To Here(1);
// dt = Open("Data table.jmp"); // Open data table
// dt1 = Open("Reference table.jmp");
// Loop to get column name Currents and Voltages
colist = {};
Col_List = dt << Get Column Names("String");
For(q = 1, q <= N Items(Col_List), q++,
If(Contains(Col_List[q], "Current") | Contains(Col_List[q], "Voltage"),
Column(Col_List[q]) << Set Selected(1);
Insert Into(colist, Col_List[q]);
)
);
// Overlay Plot
vc = dt2 << Overlay Plot( Y( Eval( colist ) ), No Overlay( 1 ),Ungroup Plots( 1 ) );
aa_refs = Associative Array(dt1:Tests << get values, dt1:Reference << get values);
// Loop to add reference line to the variability chart
For(i = 1, i <= N Items(colist), i++,
If(Contains(aa_refs, colist[i]),
Report(vc[i])[Framebox(1)] << DispatchSeg(CustomStreamSeg(3), {Line Width(2)});
Report(vc[i])[AxisBox(1)] << {Add Ref Line(aa_refs[colist[i]], "Solid", "Green", "RTS", 2)};
);
);

Re: Aggiungi riga di riferimento dalla tabella di riferimentoEcco una soluzione leggermente diversa, leggendo direttamente la tabella di riferimento
Names Default To Here( 1 );
Clear Globals();
//dt = Open( "Data table.jmp" ); // Open data table
dt = Data Table( "data table" );
// Loop to get column name Currents and Voltages
colist = {};
Col_List = dt << Get Column Names( "String" );
For( q = 1, q <= N Items( Col_List ), q++,
If( Contains( Col_List[q], "Current" ) | Contains( Col_List[q], "Voltage" ),
Column( Col_List[q] ) << Set Selected( 1 );
Insert Into( colist, Col_List[q] );
)
);
// Var Chart
vc = dt << Variability Chart(
Y( (Eval( colist )) ),
X( :Wafer ID ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Show Range Bars( 0 ),
Std Dev Chart( 0 ),
Points Jittered( 1 )
);// Reference data table
//dt1 = Open( "Reference table.jmp" );
dt1 = Data Table( "reference table" );
xb = Column( dt1, "Reference" ) << getValues;
// Loop to add reference line to the variability chart
For( i = 1, i <= N Items( vc ), i++,
//Report( vc[i] )[Framebox( 1 )] << DispatchSeg( CustomStreamSeg( 3 ), {Line Width( 2 )} );
testVal = Word( -2, Report( vc[i] )[Outline Box( 2 )] << get title, " " ) || " " || Word(
-1,
Report( vc[i] )[Outline Box( 2 )] << get title,
" "
);
testRow = dt1 << get rows where( :tests == testVal );
If( N Rows( testRow ) > 0,
Report( vc[i] )[AxisBox( 1 )] << Add Ref Line( dt1:Reference[testRow[1]], "Solid", "Green", "RTS", 2 )
);
);Re: Aggiungi riga di riferimento dalla tabella di riferimentoÈ possibile eseguire il ciclo su colist e verificare se dt1 ha quel valore specifico con l'istruzione if e, in tal caso, aggiungere una riga di riferimento in base al valore trovato da dt1. Ecco un'opzione che utilizza Associative Array (potrebbe essere necessario aggiungere il ridimensionamento all'asse Y per i grafici di variabilità, poiché le linee di riferimento possono essere nascoste a seconda del loro valore).
Names Default To Here(1);
// dt = Open("Data table.jmp"); // Open data table
// dt1 = Open("Reference table.jmp");
// Loop to get column name Currents and Voltages
colist = {};
Col_List = dt << Get Column Names("String");
For(q = 1, q <= N Items(Col_List), q++,
If(Contains(Col_List[q], "Current") | Contains(Col_List[q], "Voltage"),
Column(Col_List[q]) << Set Selected(1);
Insert Into(colist, Col_List[q]);
)
);
// Var Chart
vc = dt << Variability Chart(
Y((Eval(colist))),
X(:Wafer ID),
Analysis Type("Choose best analysis (EMS REML Bayesian)"),
Show Range Bars(0),
Std Dev Chart(0),
Points Jittered(1)
);// Reference data table
aa_refs = Associative Array(dt1:Tests << get values, dt1:Reference << get values);
// Loop to add reference line to the variability chart
For(i = 1, i <= N Items(colist), i++,
If(Contains(aa_refs, colist[i]),
Report(vc[i])[Framebox(1)] << DispatchSeg(CustomStreamSeg(3), {Line Width(2)});
Report(vc[i])[AxisBox(1)] << {Add Ref Line(aa_refs[colist[i]], "Solid", "Green", "RTS", 2)};
);
);