Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
datanaut
Level III

Compute Areas Inside Contours

Is there an embedded function within JMP or does someone know an easy way for JMP to output the area of a given contour or all the contours in a contour plot?  I can find code in python or matlab i could adapt but wondered if there was something easy already available in the community.  

 

datanaut_0-1598622823037.png

 

I'm interested in knowing the total area of each color in the plot.

7 REPLIES 7
Highlighted
Craige_Hales
Staff (Retired)

Re: Compute Areas Inside Contours

Would counting pixels be accurate enough?

Craige
Highlighted
datanaut
Level III

Re: Compute Areas Inside Contours

If I understand why counting pixels means, I think it would.
Highlighted
datanaut
Level III

Re: Compute Areas Inside Contours

I don't know how to count pixels, however. Is that function available in JMP?
Highlighted
gzmorgan0
Super User

Re: Compute Areas Inside Contours

@datanaut ,

Which version of JMP are you using? I created a script to do what you want, counting pixels, using JMP 11.   It works through JMP 13. I think it broke in JMP 14.x where x>1.  The earlier versions of JMP Save Script exposed the contour labels and colors (the 3rd argument in each contour expression below), so it was easy to parse and count matching pixels.  

	Specify Contours(
		Min( 2 ),
		Max( 8 ),
		N( 7 ),
		Contour( 1, 2, -5793511 ),
		Contour( 2, 3, -8423637 ),
		Contour( 3, 4, -10725064 ),
		Contour( 4, 5, -12632256 ),
		Contour( 5, 6, -12885662 ),
		Contour( 6, 7, -13595764 ),
		Contour( 7, 8, -14828355 ),
		Contour( 8, 8, -16517899 )
	),

After JMP 14.x Save  Script did not expose the contour colors, only

	Specify Contours( Min( 2 ), Max( 8 ), N( 7 ) ),

So the script needs to be converted to get the colors from the Legend (get journal). 

 

Let me know which version of JMP you are using. Look for a later post that should work for all versions.

image.png

 

 

Highlighted
datanaut
Level III

Re: Compute Areas Inside Contours

@gzmorgan0 

Thanks for this helpful reply.

 

I'm on JMP 14.3 on a Mac.

 

Sounds like it will be just what I need.

Highlighted
Craige_Hales
Staff (Retired)

Re: Compute Areas Inside Contours

Experiments here: Contour Plot Areas 

@gzmorgan0 -- feel free to take anything useful! It looks like you have an actual interface in mind.

Craige
Highlighted
datanaut
Level III

Re: Compute Areas Inside Contours

Thanks to you both for efforts. I may try to adapt what @Craige_Hales has done or if @gzmorgan0 has a version that works with JMP14+.
Article Labels