/ * Objetivo
En un gráfico de superficie 3D se puede establecer la configuración de los marcadores en el gráfico haciendo clic derecho y, por ejemplo, Escala de marcador, calidad de marcador, etc. Esto es fácil para un gráfico. Si tiene un grupo por grupo con muchos grupos, debe volver a hacer esto manualmente para cada gráfico, ninguna tecla de control funciona para la replicación.
Entonces, ¿cómo replicar la configuración de la opción, por ejemplo, para Escala de marcador y Calidad de marcador para todos los demás?
* /
/ * Ideas
Pensé en guardar el script y usar este script como una expresión donde podría sustituir las propiedades de Frame3D para tener las opciones deseadas. O sustituto. "ScaleBox" con "ScaleBox (Set Marker Scale (5), Set Marker Quality (0)), ScaleBox" que se encuentra dentro de la salida del comando Get Script.
Otra idea era usar XPath, pero no pude automatizar las cosas. solía
r_sp [Box (1)] [ListBox (2)] [PictureBox (1)] [ScaleBox (1)] [Display3DBox (1)] << Establecer escala de marcador (5)
que funcionó para el primero, pero no para todos los demás, ya que no pude encontrar la manera de deshacerme de los índices.
* /
Adjunté un script donde probé algunos enfoques. Agradecería cualquier solución que no sea copiar las partes en las secciones ByGroup y luego ejecutar el script nuevamente. El ejemplo tiene 3 grupos pero el caso de uso tiene aproximadamente 90 grupos.
Gracias,
Martín
/* 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?Hola martin,
Creo que esto lo hará.
Sin embargo, noté que funciona en el host de Windows pero parece no tener efecto con el host de Mac.
Quizás tenga algo que ver con cómo se usa Open GL en cada host.
Agregando @Paul_Nelson para ver si puede agregar más información sobre el artefacto de dependencia del 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 Después de ejecutar el script y verificar la configuración