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
ezorlo
Level IV

two graphs side by side

Hi there are a few similar posts but I have not found exactly what i'm looking for.

I made alpha-diversity plots of two different indices and want to present them side by side (they are different scales) 

using two Y-axes e.g. right and left is confusing. 

So I want to actually make two separate graphs and just display them side by side.

here is output from the phyloseq package in R.

ezorlo_0-1606986922115.png

 

I have the data as a table as well and want to recreate the plots in JMP. Any ideas?

Thanks,Ezra

 

2 REPLIES 2
Craige_Hales
Super User

Re: two graphs side by side

dt = Open( "$sample_data/big class.jmp" );
New Window( "two graphs",
	V List Box(
		H List Box(
			dt << Graph Builder(
				Size( 512, 442 ),
				Show Control Panel( 0 ),
				Show Legend( 0 ),
				Variables( X( :age ), Y( :height ) ),
				Elements( Points( X, Y, Legend( 5 ) ) ),
				SendToReport(
					Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "" ), Image Export Display( Normal )} ),
					Dispatch( {}, "X title", TextEditBox, {Set Text( "" )} ),
					Dispatch( {}, "Y title", TextEditBox, {Set Text( "" )} ),
					Dispatch( {}, "age", ScaleBox, {Label Row( {Major Grid Line Color( 2 ), Show Major Grid( 1 )} )} ),
					Dispatch( {}, "height", ScaleBox, {Label Row( {Major Grid Line Color( 2 ), Show Major Grid( 1 )} )} ),
					Dispatch( {}, "graph title", TextEditBox, {Set Text( "Height" )} ),
					Dispatch( {}, "Graph Builder", FrameBox, {Background Color( 32 )} )
				)
			);
// identical but for height...weight in three places
			dt << Graph Builder(
				Size( 512, 442 ),
				Show Control Panel( 0 ),
				Show Legend( 0 ),
				Variables( X( :age ), Y( :weight ) ),
				Elements( Points( X, Y, Legend( 5 ) ) ),
				SendToReport(
					Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "" ), Image Export Display( Normal )} ),
					Dispatch( {}, "X title", TextEditBox, {Set Text( "" )} ),
					Dispatch( {}, "Y title", TextEditBox, {Set Text( "" )} ),
					Dispatch( {}, "age", ScaleBox, {Label Row( {Major Grid Line Color( 2 ), Show Major Grid( 1 )} )} ),
					Dispatch( {}, "weight", ScaleBox, {Label Row( {Major Grid Line Color( 2 ), Show Major Grid( 1 )} )} ),
					Dispatch( {}, "graph title", TextEditBox, {Set Text( "Weight" )} ),
					Dispatch( {}, "Graph Builder", FrameBox, {Background Color( 32 )} )
				)
			);
		),
		H Center Box( Text Box( "two graphs", <<setfontsize( 16 ), <<setfontstyle( "bold" ) ) )
	)
);

Capture.PNG

Make the graphs interactively in graph builder, then save the script and make a new window around it.

Craige
ian_jmp
Level X

Re: two graphs side by side

And if you just want 'point and click', you can get close by setting up the graphs the way you want 'by hand', then using 'Window > Combine Windows...':

Screenshot 2020-12-03 at 11.41.54.png