Aggiunta di unità all'asse Y di un grafico di variabilitàHo una serie di elementi di prova testati su 80 dispositivi. Sto tracciando il grafico di variabilità, voglio aggiungere l'unità all'asse Y. Ho le unità in una colonna diversa. Il nome della colonna è il set di etichette predefinito. C'è un modo per aggiungere le unità all'etichetta? qualche script disponibile? allegato è il foglio di esempio e il formato di esempio di outout che voglio.

Re: Aggiunta di unità all'asse Y di un grafico di variabilitàGrazie @txnelson E @cwillden . entrambi gli script funzionano per la domanda originale.
Grazie,
Venkat
Re: Aggiunta di unità all'asse Y di un grafico di variabilitàQuesto è effettivamente quello che stavo pensando per la scissione.Bel lavoro, Jim.
L'approccio alternativo che stavo considerando eviterebbe la divisione e l'etichetta dell'asse y sarebbe solo unità.Se manca l'unità, metto semplicemente "Unità sconosciuta" al suo posto, ma puoi fare quello che vuoi lì.Questo approccio crea la parte "SendToByGroup" dello script.Funziona bene con i tuoi dati di esempio:
Names Default to Here(1);
dt = Current Data Table();
/**** Get units for each level of TestInstance ***/
testList = Associative Array(dt:TestInstance) << get keys;
unitList = {};
for(i = 1, i<=N Items(testList), i++,
temp = dt:Unit[min(dt << Get Rows Where(:TestInstance == testList[i]))];
Insert Into(unitList, If(Is Missing(temp),"Unknown Unit", temp ));
);
unitArray = Associative Array(testList, unitList);
/**** Build the Var Chart Script ****/
varChartStr = "Variability Chart(
Y( :value ),
X( :PackageID ),
Std Dev Chart( 0 ),
By( :TestInstance )";
//Loop through levels of TestInstance to add the unit label for the y-axis
for(i=1, i<= N Items(testList), i++,
varChartStr = varChartStr || Eval Insert("\[,
SendToByGroup(
{:TestInstance == "^testList[i]^"},
SendToReport(
Dispatch(
{"Variability Gauge TestInstance=^testList[i]^",
"Variability Chart for value"},
"value",
TextEditBox,
{Set Text( "^unitArray[testList[i]]^" )}
)
)
)]\");
);
//Close the script
varChartStr = varChartStr || "
);";
//Run the script
eval(parse(varChartStr));
//Add the script to the data table
Eval(Parse(Eval Insert("dt << New Script(\!"Variability Chart\!", ^varChartStr^)")));
Ecco il risultato:
Re: Aggiunta di unità all'asse Y di un grafico di variabilitàEcco uno script che produce quello che vuoi aggiungendo le Unità al nome dei Test.Ho eseguito questo confronto con il file Excel che è stato fornito.Lo script presuppone che la tabella dati sia stata aperta in JMP prima dell'esecuzione dello script.
Names Default To Here( 1 );
// This script assumes you have opened the Excel file as a JMP Data Table
dt = Current Data Table();
// Split the data into the proper form for analysis
dtSplit = dt << Split( Split By( :TestInstance ), Split( :value ), Remaining Columns( Drop( :Unit ) ), Sort by Column Property );
// Create a data table to determine the units for each test
dtUnits = dt << Summary( Group( :TestInstance, :Unit ), Freq( "None" ), Weight( "None" ), Link to original data table( 0 ) );
// Loop across the data table and add the Units to the different Test Columns in the data table
For( i = 1, i <= N Rows( dtUnits ), i++,
If( dtUnits:Unit[i] != "",
Column( dtSplit, dtUnits:TestInstance[i] ) << set name(
Column( dtSplit, dtUnits:TestInstance[i] ) << get name || " ( " || dtUnits:Unit[i] || " )"
)
)
);
// Delete the Units data table since it is no longer needed
close( dtUnits, nosave );
// Create a window to place all of the charts into
nw = New Window( "Variability Chart by PackageID", vlb = V List Box() );
// Get all of the column names
colNames = dtSplit << get column names( string, numeric );
// Loop across all of the columns and when a Test column is found,
// then create a chart for it
For( i = 1, i <= N Items( colNames ), i++,
If( Contains( colNames[i], "Test" ) == 1,
testList = ":Name(\!"" || colNames[i] || "\!")";
Eval(
Substitute(
Expr(
vlb << append( dtSplit << Variability Chart( Y( __theList__ ), X( :PackageID ), Std Dev Chart( 0 ) ) )
),
Expr( __theList__ ), Parse( testList )
)
);
)
);
Re: Aggiunta di unità all'asse Y di un grafico di variabilità@cwillden grazie, ho trasposto il foglio riportato nel formato allegato. Per favore, mostrami come aggiungere unità.
Grazie
Re: Aggiunta di unità all'asse Y di un grafico di variabilitàPenso che sarebbe più semplice in un formato più ampio (ovvero dividere la colonna "value" su TestInstance), ma se si desidera mantenerlo nel formato lungo, l'approccio più semplice potrebbe essere quello di costruire le parti SendToByGroup() in un ciclo e afferrando l'unità per ogni livello di gruppo.Posso sicuramente aiutarti più tardi stasera, ma devo scappare subito.
Re: Aggiunta di unità all'asse Y di un grafico di variabilitàGrazie @cwillden ma ho più di 200 elementi di prova, quindi questo metodo potrebbe non essere adatto a quel grande insieme di elementi di prova. Hai idea di usarlo con il loop?
Grazie.
Re: Aggiunta di unità all'asse Y di un grafico di variabilitàSe devi farlo una volta, fai clic sulle etichette degli assi e digita quello che vuoi.Se devi farlo ripetutamente, digita quello che vuoi e salva lo script.Punta questo script su qualsiasi tabella futura:
Variability Chart(
SendToByGroup( {:TestInstance == "Test1"} ),
Y( :value ),
SendToByGroup( {:TestInstance == "Test1"}, Y( :value ) ),
SendToByGroup( {:TestInstance == "Test2"}, Y( :value ) ),
SendToByGroup( {:TestInstance == "Test3"}, Y( :value ) ),
SendToByGroup( {:TestInstance == "Test4"}, Y( :value ) ),
X( :PackageID ),
Std Dev Chart( 0 ),
By( :TestInstance ),
SendToByGroup(
{:TestInstance == "Test1"},
SendToReport(
Dispatch(
{"Variability Gauge TestInstance=Test1",
"Variability Chart for value"},
"value",
TextEditBox,
{Set Text( "Unknown" )}
)
)
),
SendToByGroup(
{:TestInstance == "Test2"},
SendToReport(
Dispatch(
{"Variability Gauge TestInstance=Test2",
"Variability Chart for value"},
"value",
TextEditBox,
{Set Text( "mA" )}
)
)
),
SendToByGroup(
{:TestInstance == "Test3"},
SendToReport(
Dispatch(
{"Variability Gauge TestInstance=Test3",
"Variability Chart for value"},
"value",
TextEditBox,
{Set Text( "uA" )}
)
)
),
SendToByGroup(
{:TestInstance == "Test4"},
SendToReport(
Dispatch(
{"Variability Gauge TestInstance=Test4",
"Variability Chart for value"},
"value",
TextEditBox,
{Set Text( "mA" )}
)
)
)
)