cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
hogi
Level XII

GraphBuilder Challenge

A Jmp graph with different Overlay categories - with a trick it's possible to create it:

hogi_3-1709564330710.png

on the left: weight split by # doors

on the right: weight split by year.

 

Besides the trick, how can I use Overlay to create the graph?

 

dt = Open( "$SAMPLE_DATA/Cars.jmp" );
dt << New Column( "Count_Make",	Formula( Col Number( 1, :Make ) ));

dt << Graph Builder(
	Variables( X( :Make ), X( :Make ), Y( :Wt ), Overlay( :Year, :Doors ) ),
	Elements( Position( 1, 1 ), Box Plot( X, Y,Overlay( 2 ) ) ),
	Elements( Position( 2, 1 ), Box Plot( X, Y,Overlay( 1 ) ) ),
	Local Data Filter(
		Add Filter( columns( :Count_Make ), Where( :Count_Make >= 25 ) )
	)
)

 

2 REPLIES 2
jthi
Super User

Re: GraphBuilder Challenge

Is it necessary to use Overlay (if you need coloring, color supports multiple columns but I would most likely just rely on X-axis having both categories visible)

jthi_1-1709566882699.png

Graph Builder(
	Size(1024, 632),
	Show Control Panel(0),
	Include Missing Categories(1),
	Variables(X(:Make), X(:Doors, Position(1)), X(:Make), X(:Year, Position(2)), Y(:Wt), Color(:Doors), Color(:Year)),
	Elements(Position(1, 1), Box Plot(X(1), X(2), Y, Color(1), Legend(8))),
	Elements(Position(2, 1), Box Plot(X(1), X(2), Y, Color(2), Legend(3))),
	Local Data Filter(Add Filter(columns(:Count_Make), Where(:Count_Make >= 25.81))),
	SendToReport(
		Dispatch({}, "Make", ScaleBox, {Label Row(1, Show Major Labels(0)), Label Row(2, Show Major Grid(1))}),
		Dispatch({}, "Make", ScaleBox(2), {Label Row(1, Show Major Labels(0)), Label Row(2, Show Major Grid(1))})
	)
)

or without color

jthi_2-1709567288050.png

 

-Jarmo
hogi
Level XII

Re: GraphBuilder Challenge

nice trick

 

and this one?

hogi_0-1709578119670.png

on the left: cases split by region

on the right: cases split by year

 

dt = Open( "$SAMPLE_DATA/Seasonal Flu.jmp" );
dt << Graph Builder(
	Transform Column( "Year", Formula( Year( :Date ) ) ),
	Transform Column( "Day of Year", Formula( Day Of Year( :Date ) ) ),
	Variables(
		X( :Day of Year ),
		X( :Day of Year ),
		Y( :Flu Cases ),
		Overlay( :Year, :Region )
	),
	Elements(
		Position( 1, 1 ),
		Smoother( X, Y, Overlay( 2 ))
	),
	Elements( Position( 2, 1 ), Smoother( X, Y, Overlay( 1 )))
)

 


more wishes from hogi_2-1702196401638.png