combine Pie with other graphs?Can I combine Pie graphs with other graphs?
2 problems:
- Pie uses "X" as input for the categories - not Overlay or Y - this interferes with other data on the x axis
- Pie plots are placed at x=0, so the other x axes have to be centered around 0 (this is why I subtracted the median)

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 ) )
);
Data Exploration and VisualizationRe: combine Pie with other graphs?The most obvious answer is: Don't use Pie Charts!
Bar charts
- uses Overlay for the categories, not x
- centers the plot automatically within the view - not at 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 ) )
)
);