cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

Create Curve Plots with Overall Average Curve and Individual Replicate Curves

MathStatChem
Level VI

Hi all,

 

I'm wanting to use Graph Builder to create a graph like this (copied from the Fit Curve dissolution model free comparison report)

MathStatChem_0-1739290000313.png

 

I cannot seem to do this in graph builder.  Any suggestions?  

 

The graph needs to show each curve (specified as CurveID in the data table).

The graph needs to show the average curve by group (Curve Group).

 

The error bars are not necessary, but would be nice to have.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

@MathStatChem 

 

I got it. I split the data based on Curve Group so Y A and Y B are their own columns. Then put them both on Y. I added line element twice and use CurveID as Overlay.  For one of the lines I removed the Overlay Variable to get the mean for A and B.  The rest was manipulating thickness and colors of lines via legend and Customize.

 

Chris_Kirchberg_1-1739293690446.png

I attached split table.

Chris Kirchberg, M.S.2
Data Scientist, Life Sciences - Global Technical Enablement
JMP Statistical Discovery, LLC. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
www.jmp.com

View solution in original post

9 REPLIES 9
MathStatChem
Level VI


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

note, X should be continuous, I accidentally have it as nominal in the attached table.  

MathStatChem
Level VI


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

MathStatChem_0-1739290561984.png

is the best I can get, so far.


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

 

@MathStatChem,

 

Have you tried adding line element a second time and then manipulating the variables like so:

 

Chris_Kirchberg_1-1739291262776.png

 

 

Chris_Kirchberg_2-1739291309303.png

 

 

 

Chris Kirchberg, M.S.2
Data Scientist, Life Sciences - Global Technical Enablement
JMP Statistical Discovery, LLC. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
www.jmp.com
MathStatChem
Level VI


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

That's closer, but still cannot overlay the two curve groups.  


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

Taking it one step further and manipulating graph colors and transparencies:

 

Chris_Kirchberg_0-1739291774388.png

using JMP 18.1.2 and here is the script to recreate

Graph Builder(
	Size( 929, 685 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables(
		X( :X ),
		Y( :Y ),
		Group X( :Curve Group ),
		Overlay( :CurveID ),
		Color( :Curve Group )
	),
	Elements(
		Points( X, Y, Legend( 11 ) ),
		Line( X, Y, Legend( 13 ) ),
		Line(
			X,
			Y,
			Overlay( 0 ),
			Legend( 16 ),
			Error Interval( "Standard Deviation" )
		)
	),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				11,
				Properties( 2, {Marker( "Dot" )}, Item ID( "1", 1 ) ),
				Properties(
					3,
					{Marker( "Dot" ), Transparency( 0.5 )},
					Item ID( "2", 1 )
				),
				Properties(
					4,
					{Marker( "Dot" ), Transparency( 0.5 )},
					Item ID( "3", 1 )
				),
				Properties(
					5,
					{Marker( "Dot" ), Transparency( 0.5 )},
					Item ID( "4", 1 )
				),
				Properties(
					6,
					{Marker( "Dot" ), Transparency( 0.5 )},
					Item ID( "5", 1 )
				),
				Properties(
					7,
					{Marker( "Dot" ), Transparency( 0.5 )},
					Item ID( "6", 1 )
				)
			), Legend Model(
				13,
				Properties( 0, {Transparency( 0.5 )}, Item ID( "A", 1 ) ),
				Properties( 1, {Transparency( 0.5 )}, Item ID( "B", 1 ) ),
				Properties( 2, {Transparency( 0.5 )}, Item ID( "1", 1 ) ),
				Properties(
					3,
					{Line Style( "Solid" ), Transparency( 0.5 )},
					Item ID( "2", 1 )
				),
				Properties(
					4,
					{Line Style( "Solid" ), Transparency( 0.5 )},
					Item ID( "3", 1 )
				),
				Properties(
					5,
					{Line Style( "Solid" ), Transparency( 0.5 )},
					Item ID( "4", 1 )
				),
				Properties(
					6,
					{Line Style( "Solid" ), Transparency( 0.5 )},
					Item ID( "5", 1 )
				),
				Properties(
					7,
					{Line Style( "Solid" ), Transparency( 0.5 )},
					Item ID( "6", 1 )
				)
			), Legend Model(
				16,
				Properties(
					2,
					{Line Color( 0 ), Line Width( 4 )},
					Item ID( "Mean", 1 )
				)
			)}
		),
		Dispatch( {}, "", GraphBuilderContainerBox, {Select} ),
		Dispatch( {}, "Graph Builder", FrameBox( 2 ),
			{DispatchSeg( BarSeg( 1 ), {Line Width( 3 )} )}
		),
		Dispatch( {}, "400", LegendBox,
			{Legend Position(
				{11, [-3, -3, -1, -1, -1, -1, -1, -1], 13, [-1, -1, -1, -1, -1, -1,
				-1, -1], 16, [-3, -3, 0, -3]}
			)}
		)
	)
);
Chris Kirchberg, M.S.2
Data Scientist, Life Sciences - Global Technical Enablement
JMP Statistical Discovery, LLC. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
www.jmp.com


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

@MathStatChem 

 

I got it. I split the data based on Curve Group so Y A and Y B are their own columns. Then put them both on Y. I added line element twice and use CurveID as Overlay.  For one of the lines I removed the Overlay Variable to get the mean for A and B.  The rest was manipulating thickness and colors of lines via legend and Customize.

 

Chris_Kirchberg_1-1739293690446.png

I attached split table.

Chris Kirchberg, M.S.2
Data Scientist, Life Sciences - Global Technical Enablement
JMP Statistical Discovery, LLC. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
www.jmp.com
MathStatChem
Level VI


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

Ok, that works.  Still a bit clunky.  And in my actual analysis project that I want to do this for, I have dozens of curve groups, and I would want to be able to filter on the curve group...which would require a very wide split table, but would not allow easily filtering on curve group.  It would be nice to be able to this with a stacked table.  

MathStatChem
Level VI


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

hogi
Level XII


Re: Create Curve Plots with Overall Average Curve and Individual Replicate Curves

related post: Graph Builder. Combine Smoother and Line - how? 

this is a quite standard type of graphs - unfortunately, or this type of graph JMP stands far behind other tools.

There are creative workarounds,  like reformatting the data table (add columns, add dummy rows) or reformatting the graph (plot by row order and hide the reverse jumps by setting the opacity to 0, original post by  @XanGregg )

 

one example:

dt = Open( "$DOWNLOADS/example curve data.jmp" );
dt:X << Set Modeling Type( "Continuous" );

New Column( "falling X",
	Character,
	Formula( If( :X - Lag( :X ) < 0, "", :Curve Group ) ),
);

Graph Builder(
	Size( 518, 448 ),
	Show Control Panel( 0 ),
	Summary Statistic( "Median" ),
	Graph Spacing( 4 ),
	Variables(
		X( :X ),
		Y( :Y ),
		Overlay( :Curve Group ),
		Color( :falling X )
	),
	Elements(
		Line( X, Y, Legend( 6 ), Ordering( "Row Order" ) ),
		Line( X, Y, Color( 0 ), Legend( 7 ) )
	),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				6,
				Properties( 0, {Transparency( 0 )}, Item ID( "Missing", 1 ) ),
				Properties( 1, {Transparency( 0.5 )}, Item ID( "A", 1 ) ),
				Properties( 2, {Transparency( 0.5 )}, Item ID( "B", 1 ) )
			), Legend Model(
				7,
				Properties( 0, {Line Color( 3 )}, Item ID( "A", 1 ) )
			)}
		)
	)
);

 

hogi_0-1739298696666.png

 

real solutions:
a) 
Graph Builder - Overlay by multiple columns :

 

b)   Implement a one-click option in Graph Builder to hide the jump-back lines:

Graph Builder: Line - possibility to add breaks 

Both wishes collected many Kudos over the years, so let's hope that one of them will be implemented soon ...