d0=Open("$SAMPLE_DATA/Big Class.jmp");
d0 << Select Where( age < 16 );
dt = d0 << Subset(
Output Table( "test" ),
Selected Rows( 1 ),
selected columns( 0 )
);
Try( dt << Delete Table Property( "Source" ) );
d2 = dt << Summary(
Group( age ),
Freq( 0 ),
Weight( 0 ),
Link to original data table( 0 ),
Output Table( "tem" )
);
Column( d2, 2 ) << set name( "row" );
mi = Min( d2[0, "row"] );
ca = "ratio";
New Column( ca );
Column( ca ) << Formula( Round( row / mi, 2 ) );
d2 << run formulas;
Column( ca ) << deleteFormula;
dt << Update( With( d2 ), Match Columns( age = age ) );
Close( d2, nosave );
Current Data Table( dt );
ca = "list";
New Column( ca );
Column( ca ) << Formula(
If( Row() == 1 | age != Lag( age, 1 ),
r = Row();
1;
,
Floor( (Row() - r) / ratio + 1 )
)
);
d0 << run formulas;
Column( ca ) << deleteFormula;
p1 = dt << Graph Builder(
Size( 690, 466 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Show X Axis( 0 ),
Show Y Axis( 0 ),
Variables(
X( :weight ),
Y( :height ),
Group X( :age, Show Title( 0 ) ),
Color( :sex )
),
Elements(
Bar(
X,
Y,
Legend( 5 ),
Response Axis( "X" ),
Summary Statistic( "Sum" )
)
),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Hide( 1 )}
),
Dispatch( {}, "X title", TextEditBox, {Hide( 1 )} ),
Dispatch( {}, "Y title", TextEditBox, {Hide( 1 )} )
)
);
p2 = dt << Graph Builder(
Size( 686, 404 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Show X Axis( 0 ),
Show Y Axis( 0 ),
X Group Edge( "Bottom" ),
Variables(
X( :list ),
Y( :height ),
Group X( :age, Show Title( 0 ) )
),
Elements(
Bar( X, Y, Legend( 5 ), Summary Statistic( "Sum" ) )
),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Hide( 1 )}
),
Dispatch( {}, "X title", TextEditBox, {Hide( 1 )} ),
Dispatch( {}, "Y title", TextEditBox, {Hide( 1 )} )
)
);Direi che non puoi (e non dovresti) averli negli stessi grafici poiché mostrano informazioni diverse (almeno in base agli script del generatore di grafici). Se necessario, è possibile combinarli in un singolo "report" utilizzando Combina Windows

potresti ridimensionare la "lista" di x 30 e usarla sull'asse X, il che darà questo grafico:

Vedi altro......dt << New Column( "list*30",
Formula( :list * 30 )
);
dt << Graph Builder(
Variables(
X( :weight ),
X( :"list"n, Position( 1 ) ),
Y( :height ),
Y( :height ),
Group X( :age, Show Title( 0 ) ),
Color( :sex )
),
Elements(
Position( 1, 1 ),
Bar(
X( 1 ),
Y,
Legend( 5 ),
Response Axis( "X" ),
Summary Statistic( "Sum" )
)
),
Elements(
Position( 1, 2 ),
Bar( X( 2 ), Y, Color( 0 ), Legend( 6 ), Summary Statistic( "Sum" ) )
)
);
Grazie, ho corretto il codice.
con la colonna originale ("lista") il grafico in basso verrà schiacciato a sinistra.
con "list*30" le barre riempiranno l'intero grafico.
d0 = Current Data Table();
d0 << Select Where( age < 16 );
dt = d0 << Subset( Output Table( "test" ), Selected Rows( 1 ), selected columns( 0 ) );
Try( dt << Delete Table Property( "Source" ) );
d2 = dt << Summary( Group( age, height ), Sum( weight ), Freq( 0 ), Weight( 0 ), Link to original data table( 0 ), Output Table( "tem" ) );
ma = Max( d2[0, 4] );Close( d2, nosave );
d2 = dt << Summary( Group( age ), Freq( 0 ), Weight( 0 ), Link to original data table( 0 ), Output Table( "tem" ) );Column( d2, 2 ) << set name( "row" );
mi = Min( d2[0, "row"] );
ca = "ratio";New Column( ca );Column( ca ) << Formula( Round( row / mi, 2 ) );d2 << run formulas;Column( ca ) << deleteFormula;
dt << Update( With( d2 ), Match Columns( age = age ) );Close( d2, nosave );
Current Data Table( dt );ca = "list";New Column( ca );
Column( ca ) << Formula(If( Row() == 1 | age != Lag( age, 1 ),r = Row();1,Ceiling( (Row() - r + 1) / ratio * ma / mi ) ));d0 << run formulas;Column( ca ) << deleteFormula;