cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

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

 

3 REPLIES 3
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 XIII

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



once Overlay by multiple columns is available, it will be:

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

 

 

hogi
Level XIII

Re: GraphBuilder Challenge

any idea?

Recommended Articles