cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit. Register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
hogi
Level XI

How to use multiple columns with shape?

The shape option in Graph Builder is very helpful to generate fancy plots with just a few baby-steps:

dt = Open("https://en.wikipedia.org/wiki/List_of_countries_by_system_of_government",HTML Table( 6, Column Names( 1 ), Data Starts( 2 ) ));

dt << New Column( "Country",Character,"Nominal",Formula( Word( 1, :Name, "{\!"" ) ));

dt << Graph Builder(
	Variables( Color( :Constitutional form ), Shape( :Country ) ),
	Elements( Map Shapes( Legend( 5 ) ) )
);

gives you:

hogi_0-1712461690109.png

... and you can use the legend to quickly select the appropriate countries - all respective 

 

 

 

 


Now let's look at a second, more complicated example:

hogi_1-1712464409014.png

View more...
dt2 = Open(
	"https://en.wikipedia.org/wiki/List_of_countries_and_territories_by_the_United_Nations_geoscheme",
	HTML Table( 1, Column Names( 1 ), Data Starts( 2 ) )
);


dt2 << New Column( "Country",Character,Formula( Word( 1, :"Country / Area"n, "{\!"" ) ));

For Each Row(
		dt2,
		dt2:Geographical Subregion[] = Map Value(
			dt2:Geographical Subregion,
			{"Australia and New Zealand", "-", "Caribbean", "East", "Central America",
			"central", "Central Asia", "central", "Eastern Africa", "East",
			"Eastern Asia", "East", "Eastern Europe", "East", "Melanesia", "-",
			"Micronesia", "-", "Middle Africa", "central", "Northern Africa",
			"North", "Northern America", "North", "Northern Europe", "North",
			"Polynesia", "-", "South America", "South", "South-eastern Asia",
			"South", "Southern Africa", "South", "Southern Asia", "South",
			"Southern Europe", "South", "Western Africa", "West", "Western Asia",
			"West", "Western Europe", "West", "—", "-"},
			Unmatched( dt2:Geographical Subregion )
		)
);

dt2 << Graph Builder(
	Variables(
		Page( :Continental Region, Levels per Row( 2 ) ),
		Color( :Geographical Subregion ),
		Shape( :Country )
	),
	Elements( Map Shapes( Legend( 24 ) ) )
)

The task:
in addition to the shapes of the countries, add a compass to quickly select the countries of the respective region.
With the shapes functionality it should be easy to generate the shapes for the compass  - but I don't know how to use 2 different columns as shapes ...

 

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XI

Re: How to use multiple columns with shape?

edit: 

 

workaroud: for shapes one can apply the same trick as for the Heatmap graph:
add another point plot to generate the additional controls outside of the wafer map

hogi_1-1712610056886.png

 

 

View solution in original post

2 REPLIES 2
hogi
Level XI

Re: How to use multiple columns with shape?

The actual application case is: Wafermaps

 

 

View more...
Names Default to HERE(1);
Try(close(dt, noSave));
dt = Open( "$SAMPLE_DATA/Wafer Stacked.jmp" );
dtX = dt<< Summary(
	Group( :Lot_Wafer Label ),
	Freq( "None" ),
	Weight( "None" ),
	output table name( "Summary of Wafer Stacked grouped by Lot_Wafer Label" )
);

dtX << New Column( "split",Formula( Random Integer( 0, 20 ) ));

dt << Update(
	With( dtX ),
	Match Columns( :Lot_Wafer Label = :Lot_Wafer Label ),
	Add Columns from Update Table( :split ),
	Replace Columns in Main Table( None )
);
dt << New Column( "group",

	Formula( If( sqrt(:X_Die^2 + y_Die^2) < :split, -20, 20 ) ),
	Value Labels( {-20 = "inner", 20 = "outer"} )
);
dt << New Column("y",set each value(20));

dt << Graph Builder(
	Size( 839, 264 ),
	Show Control Panel( 0 ),
	Show Title( 0 ),
	Summary Statistic( "Median" ),
	Graph Spacing( 4 ),
	Variables(
		X( :X_Die ),
		X( :group, Position( 1 ) ),
		Y( :Y_Die ),
		Y( :y, Position( 1 ) ),
		Wrap( :Wafer, Levels per Row( 5 ) ),
		Overlay( :group ),
		Color( :group )
	),
	Elements(
		Heatmap( X( 1 ), X( 2 ), Y( 1 ), Y( 2 )),
		Points( X( 2 ), Y( 2 ), Legend( 7 ) )
	),
	Local Data Filter(
		Close Outline( 1 ),
		Conditional,
		Add Filter(
			columns( :Lot, :Wafer ),
			Where( :Lot == "2" ),
			Where( :Wafer == {5, 6, 7, 8} ),
			Display( :Lot, N Items( 5 ) ),
			Display( :Wafer, N Items( 6 ) )
		)
	),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				7,
				Properties(
					1,
					{Marker( "Dot" ), Marker Size( 12 )},
					Item ID( "inner", 1 )
				),
				Properties(
					2,
					{Marker( "Circle" ), Marker Size( 12 )},
					Item ID( "outer", 1 )
				)
			)}
		)
	)
);
hogi
Level XI

Re: How to use multiple columns with shape?

edit: 

 

workaroud: for shapes one can apply the same trick as for the Heatmap graph:
add another point plot to generate the additional controls outside of the wafer map

hogi_1-1712610056886.png