/* Obbiettivo
In un grafico a superficie 3D è possibile impostare le impostazioni dei marker nel grafico facendo clic con il tasto destro ed es Scala dei marker, qualità dei marker e così via. Questo è facile per un grafico. Se si dispone di un gruppo per molti gruppi, è necessario eseguire nuovamente questa operazione manualmente per ciascun grafico, nessun tasto di controllo funziona per la replica.
Quindi, come replicare l'impostazione dell'opzione, ad es. Per Marker Scale e Marker Quality su tutti gli altri ???
* /
/ * Idee
Ho pensato di salvare lo script e utilizzare questo script come un'espressione in cui avrei potuto sostituire le proprietà Frame3D in modo da avere le opzioni desiderate. O sostituto. "ScaleBox" con "ScaleBox (Set Marker Scale (5), Set Marker Quality (0)), ScaleBox" che si trova nell'output del comando Get Script.
Un'altra idea era quella di utilizzare XPath, ma non sono riuscito ad automatizzare le cose. ero solito
r_sp [Riquadro (1)] [ListBox (2)] [PictureBox (1)] [ScaleBox (1)] [Display3DBox (1)] << Imposta scala marker (5)
che ha funzionato per il primo, ma non per tutti gli altri in quanto non riuscivo a capire come liberarmi degli indici.
* /
In allegato una sceneggiatura in cui ho provato alcuni approcci. Apprezzerei qualsiasi soluzione diversa da quella di copiare le parti nelle sezioni ByGroup e quindi eseguire nuovamente lo script. L'esempio ha 3 gruppi ma il caso d'uso ha circa 90 gruppi.
Grazie,
balestruccio
/* Objective
In a 3D surface Plot one can set the settings for Markers in the graph by right click and e.g. Marker Scale, Marker Quality and so forth. This is easy for one graph. If you have a by Group with many groups you have to do this for each graph manually again, no control key works for replication.
So how to replicate setting the option e.g. for Marker Scale and Marker Quality to all others???
*/
/* Ideas
I thought about saving the script and use this script as an expression where I could substitute Frame3D properties so that I have the desired options. Or substitute . "ScaleBox" with "ScaleBox(Set Marker Scale(5), Set Marker Quality(0)), ScaleBox" which is within the output of the Get Script command.
Another idea was to use XPath, but I failed to automate things. I used
r_sp[Box(1)][ListBox(2)][PictureBox(1)][ScaleBox(1)][Display3DBox(1)] << Set Marker Scale (5)
which worked for the first but not all others as I couldn't figure out how to get rid of the indices.
*/
Names Default to Here(1);
// Generate table and report (3D Plot) - this usually is done manually
dt = Open("$SAMPLE_DATA/Iris.jmp");
// Surface Plot, Goal is to set Marker Quality for all ByGroups to 0. Currently it is just for the first group.
sp = dt << Surface Plot(
SendToByGroup( {:Species == "setosa"} ),
Columns( :Sepal length, :Sepal width, :Petal length ),
Datapoints Choice( "Points" ),
Response( :Petal length ),
SetVariableAxis( :Sepal length, Axis Data( {} ) ),
SetVariableAxis( :Sepal width, Axis Data( {} ) ),
SendToByGroup( {:Species == "setosa"}, SetZAxis( z#1, Current Value( 1.45 ) ) ),
SendToByGroup(
{:Species == "versicolor"},
SetZAxis( z#1, Current Value( 4.125 ) )
),
SendToByGroup(
{:Species == "virginica"},
SetZAxis( z#1, Current Value( 5.75 ) )
),
SetXVariable( :Sepal length ),
SetYVariable( :Sepal width ),
SendToByGroup(
{:Species == "setosa"},
Frame3D(
Set Rotation( -54, 0, 38 ),
Set Marker Quality( 0 ),
Set Marker Scale( 1.585 )
)
),
SendToByGroup(
{:Species == "versicolor"},
Frame3D( Set Rotation( -54, 0, 38 ) )
),
SendToByGroup(
{:Species == "virginica"},
Frame3D( Set Rotation( -54, 0, 38 ) )
),
By( :Species )
);
// Get report
r_sp = sp << report();
// usually one would need to use:
// r_sp = currentreport();
// idea 1: Build Expression and to be substituted with string
reportExpr = Expr(
Surface Plot(
SendToByGroup( {:Species == "setosa"} ),
Columns( :Sepal length, :Sepal width, :Petal length ),
Datapoints Choice( "Points" ),
Response( :Petal length ),
SetVariableAxis( :Sepal length, Axis Data( {} ) ),
SetVariableAxis( :Sepal width, Axis Data( {} ) ),
SendToByGroup( {:Species == "setosa"}, SetZAxis( z#1, Current Value( 1.45 ) ) ),
SendToByGroup( {:Species == "versicolor"}, SetZAxis( z#1, Current Value( 4.125 ) ) ),
SendToByGroup( {:Species == "virginica"}, SetZAxis( z#1, Current Value( 5.75 ) ) ),
SetXVariable( :Sepal length ),
SetYVariable( :Sepal width ),
SendToByGroup(
{:Species == "setosa"},
Frame3D( _property_ )
),
SendToByGroup( {:Species == "versicolor"}, Frame3D( _property_ ) ),
SendToByGroup( {:Species == "virginica"}, Frame3D( _property_ ) ),
By( :Species )
)
);
ReplaceWith = "Set Rotation( -54, 0, 38 ),Set Marker Quality( 0 ), Set Marker Scale( 5 )" ;
// NameExpr(reportExpr);
tmp = Substitute(
NameExpr( reportExpr),
Expr( _property_ ), ReplaceWith,
);
// This does not work as there are "..." included which throws an error obviously. I checked different approaches but gave up and ask now :)
// eval( tmp );
// idea 3: Get script and change the code, however I failed and in addition was not sure how to change the report with the new script
myExpr = r_sp << Get Script;
// what next?Ciao Martin,
Penso che questo lo farà.
Tuttavia, ho notato che funziona sull'host Windows ma sembra non avere alcun effetto con l'host Mac.
Forse ha qualcosa a che fare con il modo in cui Open GL viene utilizzato su ciascun host.
Aggiunta @Paul_Nelson per vedere se riesce ad aggiungere più informazioni approfondite al manufatto di dipendenza host.
Stan
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Iris.jmp");
sp = dt << Surface Plot(
SendToByGroup( {:Species == "setosa"} ),
Columns( :Sepal length, :Sepal width, :Petal length, :Petal width ),
Datapoints Choice( "Points" ),
Surface Color Theme( "Green to Black to Red" ),
Surface Color Theme2( "Green to White to Red" ),
Surface Color Theme3( "White to Black" ),
Surface Color Theme4( "Blue to Gray to Red" ),
Response Column Color Theme( "Blue to Green to Red" ),
Response Column Color Theme2( "Spectral" ),
Response Column Color Theme3( "Jet" ),
Response Column Color Theme4( "White to Blue" ),
Response( :Petal length ),
Surface Color Method( "Solid", "Solid", "Solid", "Solid" ),
SetVariableAxis( :Sepal length, Axis Data( {} ) ),
SetVariableAxis( :Sepal width, Axis Data( {} ) ),
SendToByGroup(
{:Species == "setosa"},
SetZAxis( Petal length, Current Value( 1.45 ), Axis Data( {} ) )
),
SendToByGroup(
{:Species == "versicolor"},
SetZAxis( Petal length, Current Value( 4.125 ), Axis Data( {} ) )
),
SendToByGroup(
{:Species == "virginica"},
SetZAxis( Petal length, Current Value( 5.75 ), Axis Data( {} ) )
),
SetXVariable( :Sepal length ),
SetYVariable( :Sepal width ),
Frame3D(
Set Walls( 1 ),
Set Rotation( -54, 0, 38 ),
Set Text Scale( 2 ),
Set Line Scale( 1 ),
Set Marker Transparency( 1 ),
Set Marker Quality( 0 ),
Set Marker Scale( 1 ),
Set View Perspective( 0.1 ),
Set View Zoom( 1 )
),
By( :Species )
);
After running script and check on settings Dopo aver eseguito lo script e verificare le impostazioni