cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
] />

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

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)

hogi_0-1775741960831.png


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 ) )
);
	

 

1 REPLY 1
hogi
Level XIII

Re: 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

hogi_1-1775744252419.png

 

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 ) )
	)
);

Recommended Articles