Hola, he creado un generador de gráficos con un script generado de la siguiente manera:
Graph Builder(
Transform Column( "Unit Number", Nominal, Formula( Char( :"Unit S/N"n ) ) ),
Size( 570, 817 ),
Show Legend( 0 ),
Variables( X( :Unit Number ), Y( :Bounding_Circle_Diameter um ) ),
Elements( Box Plot( X, Y, Legend( 6 ) ) ),
Local Data Filter(
Add Filter(
columns( :Aperture Name ),
Where( :Aperture Name == "F_4.8" ),
Display( :Aperture Name, N Items( 3 ), "List Display" )
)
),
SendToReport(
Dispatch(
{},
"Bounding_Circle_Diameter um",
ScaleBox,
{Min( 1500 ), Max( 5000 ), Inc( 500 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Bounding_Circle_Diameter um (F/4.8)" ), Set Font Size( 20 )}
),
Dispatch( {}, "X title", TextEditBox, {Set Font Size( 18 )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Font Size( 18 )} ),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Reference Line Order( 6 ),
Add Graphics Script(
2,
Description( "" ),
Text( Center Justified, {0, 2150}, "Range: 44.4638" );
Text( Center Justified, {0, 2050}, "Mean: 2288.48" );
Text( Center Justified, {1, 2500}, "Range: 136.315" );
Text( Center Justified, {1, 2400}, "Mean: 2681.81" );
Text( Center Justified, {2, 2100}, "Range: 97.6151" );
Text( Center Justified, {2, 2000}, "Mean: 2278.41" );
)}
)
)
);Pero el texto y las posiciones se crearon manualmente con valores codificados. Como se puede ver, los datos se filtran con ciertos valores de columna. ¿Hay alguna forma en que pueda reemplazar esos valores codificados con las estadísticas de los datos respectivamente?
Posición Y del texto -> desde valores mínimos del subconjunto de datos
Media -> valor promedio del subconjunto de datos
rango -> Max - Min del subconjunto de datos
Gracias
El elemento Caption puede actualizar automáticamente las estadísticas a medida que se aplica el filtro, y tiene algunas opciones sobre dónde colocar las estadísticas.Si está utilizando JMP 17, una de las opciones es colocar las estadísticas en una tabla debajo del eje.Conservar la ubicación personalizada probablemente requiera que implemente un controlador de estado de fila JSL para calcular y reemplazar las estadísticas a través de un script.

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Graph Builder(
Size( 528, 464 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements(
Box Plot( X, Y, Legend( 6 ) ),
Caption Box(
X,
Y,
Legend( 7 ),
Summary Statistic( "Mean" ),
Summary Statistic 2( "Range" ),
Location( "Axis Table" )
)
),
Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "M" ) ) )
);
Hay una mejor metodología para usar para agregar salida de gráficos a un gráfico.Eche un vistazo a la secuencia de comandos de ejemplo a continuación para ver cómo determinar dinámicamente dónde y qué mostrar en un gráfico.

Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
// Create the graph
gb = Graph Builder(
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
// Access the report output
rgb = gb << report;
// Add a graphics script to the report output
rgb[framebox( 1 )] << add graphics script(
// Find the parametrics of the displayed graph
xMaxAxis = rgb[AxisBox( 1 )] << get max;
xMinAxis = rgb[AxisBox( 1 )] << get min;
yMaxAxis = rgb[AxisBox( 2 )] << get max;
yMinAxis = rgb[AxisBox( 2 )] << get min;
// Calculate the desired column stats
heightMean = Col Mean( :height );
heightRange = Col Max( :height ) - Col Min( :height );
// Calculate the xy position on the graph to display the text
pos = As List(
Matrix( (xMinAxis + .1 * (xMaxAxis - xMinAxis)) |/ (yMaxAxis - .1 * (yMaxAxis - yMinaxis)) )
);
// Write out the text
Text( Center Justified, pos, "Mean: " || Format( heightMean, "fixed dec", 7, , 2 ) );
// Change the display position for the next line to be displayed
pos[2] = pos[2] - .05 * (yMaxAxis - yMinaxis);
// Write out the new line
Text( Center Justified, pos, "Range: " || Format( heightMean, "fixed dec", 7, , 2 ) );
);
Algunos puntos sobre el uso de un script de gráficos:
- El cálculo del script de gráficos se producirá cada vez que se actualice la pantalla.
- El cálculo no utiliza los estados de fila, por lo que seguirá teniendo problemas con los filtros.
- Si guarda el script de la plataforma y lo vuelve a ejecutar más tarde, no funcionará porque no es autónomo.Esto también afecta el guardado en un flujo de trabajo, proyecto, tablero o en un archivo JRP.