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
JZ
JZ
Level I

Creating Panel Plot using pivoted data

Hi JMP Community,

 

I'm using JMP 17.0.0 and I understand that I can use the "Wrap" box in Graph Builder to create a panel plot for an unpivoted dataset. 

 

However, how do I create a panel plot for a dataset that has already been pivoted? The closest I can come up with is to drag individual columns to the y-axis of graph builder to stack the plots one by one, but not in a panel format. 

 

Would love to hear everyone's input on this. Thanks!

 

JZ_0-1724172598393.png

 

2 REPLIES 2
jthi
Super User

Re: Creating Panel Plot using pivoted data

With JMP you might have to utilize table in both formats (wide/split or tall/stack) so stack your data and create the plot (unless you want to add them as separate columns to y-axis like you have done).

-Jarmo
hogi
Level XII

Re: Creating Panel Plot using pivoted data

- Often Graph Builder can do the pivoting, no need to do it manually.

- as Jarmo suggested, "stack" the values and use "Label" to wrap the plots.

- if you need different axis scales for the individual plots, "Wrap" will not work.
-> Upgrade to JMP18 and use "Page" instead of "Wrap"

hogi_0-1724183095637.png

 

dt = Open( "$SAMPLE_DATA/Water Treatment.jmp" );

dtstacked = dt  << Stack(
	columns(
		:"Q-E"n, :"ZN-E"n, :"PH-E"n, :"DBO-E"n, :"DQO-E"n, :"SS-E"n, :"SSV-E"n,
		:"SED-E"n, :"COND-E"n
	),
	"Non-stacked columns"n( Keep( :Date ) )
);

dtstacked  << Graph Builder(
	Transform Column(
		"Month[Date]",
		Format( "Format Pattern", "<MM></><YYYY>", 15 ),
		Formula( Date Increment( :Date, "Month", 0 ) )
	),
	Link Page Axes( "X Only" ),
	Replicate Linked Page Axes( 0 ),
	Variables(
		X( :"Month[Date]"n ),
		Y( :Data ),
		Page( :Label, Levels per Row( 3 ), Show Title( 0 ) )
	),
	Elements(
		Points( X, Y, Summary Statistic( "Mean" ) ),
		Smoother( X, Y )
	)
);