Posso chiedere se è possibile utilizzare il modello ppt personalizzato. dove possiamo aggiungere più grafici in una diapositiva se abbiamo un modello?
Capisco perfettamente quello che stai chiedendo. Tuttavia, a volte le funzionalità disponibili in JMP destinate all'utilizzo interattivo non si adattano molto bene al mondo degli script. Il filtro dati locale è uno di questi. È davvero uno strumento interattivo fantastico, ma nello script qui sotto vedrai che il suo utilizzo in uno script rende lo script più complesso. E la funzione interattiva in cui i diversi valori che sono ben visualizzati nell'elenco dei filtri non sono disponibili dal filtro quando vengono utilizzati in JSL.
Ecco lo script che utilizza un filtro dati locale con script
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
// Get the levels of the Sex column. The Summarize function will
// create a list of the different levels of whatever column is
// specified in the "By" claue
Summarize( dt, GroupBy = By( :Sex ) );
gb = Graph Builder(
invisible,
Size( 517, 437 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Box Plot( X, Y, Legend( 3 ) ) )
);
For( i = 1, i <= N Items( GroupBy ), i++,
gb << Local Data Filter( Add Filter( columns( :Sex ), Where( :sex == GroupBy[i] ) ), Mode( Show( 1 ), Include( 1 ) ) );
If( i == 1,
gb << Save Presentation( "$TEMP/jmp_example2.pptx" ),
gb << Save Presentation( "$TEMP/jmp_example2.pptx", Append )
);
gb << remove data filter;
);
Open( "$TEMP/jmp_example2.pptx" );
Ecco l'esempio che ho utilizzato per rispondere alle tue domande, che non utilizza il filtro dati locale e in realtà ottiene una versione migliore dell'output desiderato.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
// Get the levels of the Sex column. The Summarize function will
// create a list of the different levels of whatever column is
// specified in the "By" claue
Summarize( dt, GroupBy = By( :Sex ) );
For( i = 1, i <= N Items( GroupBy ), i++,
gb = dt << Graph Builder(
// The invisible option helps to keep the desktop clean
invisible,
Size( 517, 437 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Box Plot( X, Y, Legend( 3 ) ) ),
// Here is an easy way to subset the data used in the grap
Where( :sex == GroupBy[i] )
);
If(i==1,
gb << Save Presentation( "$TEMP/jmp_example.pptx" ),
gb << Save Presentation( "$TEMP/jmp_example.pptx", Append );
);
);
Open( "$TEMP/jmp_example.pptx" );
Il secondo esempio è un codice molto più semplice
Per evitare che i grafici vengano visualizzati mentre il codice è in esecuzione, ma non è stato scritto nel ppt, è possibile specificare l'opzione "Invisibile" all'interno della piattaforma. Ho anche aggiunto un modo per gestire il tuo filtro in modo che tu possa vedere un modo semplice per gestirlo
Sottolineerò anche che tutte queste opzioni, ecc. sono documentate e illustrate attraverso esempi @:
Aiuto==>Indice degli script
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
gb = dt << Graph Builder(
// The invisible option helps to keep the desktop clean
invisible,
Size( 517, 437 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Box Plot( X, Y, Legend( 3 ) ) ),
// Here is an easy way to subset the data used in the grap
Where( :sex == "F" )
);
New Window( "the graph", myvlb = V List Box() );
myvlb << append( Report( gb ) );
Ecco uno script di esempio.
Names Default to Here( 1 );
// The open function below, just need to point to the .xls or .xlsx file you want to open
dt=open("$SAMPLE_DATA\Big Class.jmp");
// Run the Distribution Platform
dis=dt<<DISTRIBUTION></DISTRIBUTION>