cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar

Overlaying contour plots

I have two contour plots that have the same X and Y scales (Surface Velocity on the horizontal axis, Travel Speed on the vertical).  The contours on the first graph represent Heat Flux, the contours on the second represent Flow Stress.  I've tried following the solution that calls for copying the frame contents from one plot and pasting the contents onto the second plot, but nothing happens!  Is it not possible to combine contour plots when the contours represent different things?

 

AdditiveMustang_0-1747837100352.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Victor_G
Super User

Re: Overlaying contour plots

Hi @AdditiveMustang,

 

Welcome in the Community !

 

The method you mentioned will only copy and paste the styling, format, colors, etc... of one graph to the other.
If you want to overlay two different responses on the same experimental space, I would recommend using the Contour Profiler with the prediction formula of your two responses. 

Example on the "Bounce Data" dataset with two prediction formula responses Stretch and Price (added) obtained from models :

Victor_G_1-1747838117681.png

 

Hope this answer will help you,

Victor GUILLER

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)

View solution in original post

3 REPLIES 3
Victor_G
Super User

Re: Overlaying contour plots

Hi @AdditiveMustang,

 

Welcome in the Community !

 

The method you mentioned will only copy and paste the styling, format, colors, etc... of one graph to the other.
If you want to overlay two different responses on the same experimental space, I would recommend using the Contour Profiler with the prediction formula of your two responses. 

Example on the "Bounce Data" dataset with two prediction formula responses Stretch and Price (added) obtained from models :

Victor_G_1-1747838117681.png

 

Hope this answer will help you,

Victor GUILLER

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)

Re: Overlaying contour plots

Your question: "Is it not possible to combine contour plots when the contours represent different things?". Not within the Contour Plot platform, as far as I know. But I have a trick that might work, using Graph Builder, if the contour line labels are not critical. 

I guess your data is currently in a "wide" format: (X, Y, Z1, Z2). See the attached data table and run the Table Script for an example of how to first stack the data into a "tall" format (X, Y, Z, Label), then split the Y-Axis into (X, Y1, Y2, Z). 

The next step is to create the contour plot in Graph Builder with both Y1 and Y2 in the Y-Axis role. Move one of them to the right to create a "dual" Y-Axis. This will give you two overlaid Contour Plots with separate color scales. Each color scale can be customized individually. This is also included in the Table Script in the attached Data Table. Also copied the Table Script below for reference. 

Hope this helps! 

christianz_1-1747916026941.png

// Stack the data and add a label column
stacked_table = Current Data Table() << Stack(
	columns( :Z1, :Z2 ),
	Stacked Data Column( "Z" ),
	Stack By Row( 0 ),
	Output Table( "Stacked Data" )
);

// Create Y1 and Y2 columns
stacked_table << Apply Formula(
	Columns( :Y ),
	Formula( If( Contains( :Label, "1" ), :Y, Empty() ) ),
	Output( New Formula( "Y1" ) )
);
stacked_table << Apply Formula(
	Columns( :Y ),
	Formula( If( Contains( :Label, "2" ), :Y, Empty() ) ),
	Output( New Formula( "Y2" ) )
);

stacked_table << Graph Builder(
	Size( 1890, 898 ),
	Show Control Panel( 0 ),
	Legend Position( "Inside Left" ),
	Variables(
		X( :X ),
		Y( :Y1 ),
		Y( :Y2, Position( 1 ), Side( "Right" ) ),
		Color( :Z )
	),
	Elements(
		Contour(
			X,
			Y( 1 ),
			Legend( 5 ),
			Fill( 0 ),
			Line( 1 ),
			Number of Levels( 12 ),
			Smoothness( 0.17934942968627 )
		),
		Contour(
			X,
			Y( 2 ),
			Legend( 6 ),
			Fill( 0 ),
			Line( 1 ),
			Number of Levels( 10 ),
			Smoothness( 0.135425360392331 )
		)
	),
	SendToReport(
		Dispatch( {}, "X", ScaleBox,
			{Min( 3.83582993593477 ), Max( 8 ), Inc( 1 ), Minor Ticks( 1 )}
		),
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				5,
				Properties(
					0,
					{gradient( {Color Theme( "Viridis" )} )},
					Item ID( "Z", 1 )
				)
			), Legend Model(
				6,
				Properties(
					0,
					{gradient(
						{Color Theme( "Black Body" ), Scale Values( [0 1] )}
					)},
					Item ID( "Z", 1 )
				)
			)}
		)
	)
);

 

Re: Overlaying contour plots

Sadly, my data occupies the same range on the X and Y axes.  I was wanting to overlay contours of empirical data, but the contour profiler only works with models.  I ended up putting the prediction equations for each dependent variable into the contour profiler to get the overlaid contours that I needed.  Thanks for your reply though.

Recommended Articles