將餅圖與其他圖表結合?我可以將餅圖與其他圖表組合在一起嗎?
兩個問題:
- 圓餅圖使用「X」作為類別輸入,而不是疊加層或Y軸,這會幹擾x軸上的其他資料。
- 圓餅圖的 x 軸座標為 0,因此其他 x 軸座標必須以 0 為中心(這就是我減去中位數的原因)。

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
Graph Builder(
Transform Column( "pie: sex", Nominal, Formula( "pie" ) ),
Transform Column(
"height-median",
Formula(
:height - Col Quantile(
:height,
0.5
)
)
),
Variables(
X( :sex ),
X( :"height-median"n, Position( 1 ) ),
Y( :"pie: sex"n ),
Y( :weight ),
Group X( :age )
),
Elements( Position( 1, 1 ), Pie( X( 1 )) ),
Elements( Position( 1, 2 ), Points( X( 2 ), Y ) )
);
數據探索與視覺化回覆:如何將餅圖與其他圖表結合?最顯而易見的答案是:不要使用圓餅圖!
長條圖
- 使用覆蓋來顯示類別,而不是 x
- 自動將圖表置中顯示在檢視中,而不是居中顯示在 0 處

Graph Builder(
Variables(
X( :height ),
Y( :ratio ),
Y( :weight ),
Group X( :age ),
Overlay( :sex )
),
Relative Sizes( "Y", [66 119] ),
Elements(
Position( 1, 1 ),
Bar(
Y,
Legend( 11 ),
Bar Style( "Stacked" ),
Summary Statistic( "% of Factor" )
)
),
Elements(
Position( 1, 2 ),
Points( X, Y, Overlay( 0 )),
Smoother( X, Y, Overlay( 0 ) )
)
);