cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
david707
Level III

Add secondary x-axis but don't sort by it

This is going to be hard to explain by text so please see images below. Basically I'd like to have grouped by category below the main x-axis without it messing up the sort order. Whilst it's possible to have category "above" the main x-axis, this doesn't look nice and causes category grid lines to be drawn every entry instead of only when it changes.

 

jmp request.png

1 ACCEPTED SOLUTION

Accepted Solutions
vince_faller
Super User (Alumni)

Re: Add secondary x-axis but don't sort by it

So You could readd the desired order below that even, then turn off the third axis. 

2019-07-10_14-59-17.png

 

Names default to here(1);
dt = New Table( "Test",
	Add Rows( 6 ),
	New Column( "Desired Order",
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4, 5, 6] )
	),
	New Column( "Category",
		Character,
		"Nominal",
		Set Values( {"A", "B", "B", "A", "A", "B"} )
	),
	New Column( "Data",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4, 5, 6] )
	)
);

dt = Graph Builder(
	Variables(
		X( :Desired Order ),
		X( :Category, Position( 1 ) ),
		X( :Desired Order, Position( 1 ) ),
		Y( :Data ),
		Color( :Category )
	),
	Elements( Points( X( 1 ), X( 2 ), Y, Legend( 107 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Desired Order",
			ScaleBox,
			{Label Row(
				3,
				{Automatic Tick Marks( 0 ), Show Major Labels( 0 ),
				Show Major Ticks( 0 )}
			)}
		),
		Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
	)
);

Hope that works for you.

 

2019-07-10_14-59-17.png  

Vince Faller - Predictum

View solution in original post

1 REPLY 1
vince_faller
Super User (Alumni)

Re: Add secondary x-axis but don't sort by it

So You could readd the desired order below that even, then turn off the third axis. 

2019-07-10_14-59-17.png

 

Names default to here(1);
dt = New Table( "Test",
	Add Rows( 6 ),
	New Column( "Desired Order",
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4, 5, 6] )
	),
	New Column( "Category",
		Character,
		"Nominal",
		Set Values( {"A", "B", "B", "A", "A", "B"} )
	),
	New Column( "Data",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4, 5, 6] )
	)
);

dt = Graph Builder(
	Variables(
		X( :Desired Order ),
		X( :Category, Position( 1 ) ),
		X( :Desired Order, Position( 1 ) ),
		Y( :Data ),
		Color( :Category )
	),
	Elements( Points( X( 1 ), X( 2 ), Y, Legend( 107 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Desired Order",
			ScaleBox,
			{Label Row(
				3,
				{Automatic Tick Marks( 0 ), Show Major Labels( 0 ),
				Show Major Ticks( 0 )}
			)}
		),
		Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
	)
);

Hope that works for you.

 

2019-07-10_14-59-17.png  

Vince Faller - Predictum