<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cross section of a 2D plot in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392705#M64292</link>
    <description>&lt;P&gt;Also, the contour plot (not graph builder's, use the contour platform) can save gridded data. As long as you want vertical or horizontal slices, it should be a row or column from the gridded data.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$sample_data/big class.jmp" );
// step 1: use the contour plot to get a grid of the data
cp = dt &amp;lt;&amp;lt; Contour Plot(
    X( :height, :weight ),
    Y( :age ),
    Show Data Points( 0 ),
    Fill Areas( 0 ),
    Label Contours( 0 ),
    Transform( "Range Normalized" ),
    Specify Contours( Min( 13 ), Max( 16.5 ), N( 8 ) )
);
nres = 100; // make this bigger if you think there is meaningful data there

dtGrid = cp &amp;lt;&amp;lt; generate grid( nres, nres );

cp&amp;lt;&amp;lt;closewindow;
close(dt,nosave);&lt;BR /&gt;
// step 2: make the cross section
dtGrid:height&amp;lt;&amp;lt;setModelingType(nominal);

dtGrid &amp;lt;&amp;lt; Graph Builder(
    Size( 522, 525 ),
    Show Control Panel( 0 ),
    Variables( X( :weight ), Y( :age ) ),
    Elements( Points( X, Y, Legend( 204 ) ), Smoother( X, Y, Legend( 205 ) ) ),
    Local Data Filter(
        Add Filter( columns( :height ), Where( :height == 67.5050505050505 ), Display( :height, N Items( 15 ), Find( Set Text( "" ) ) ) )
    )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Drive the height selector with up and down arrows." style="width: 821px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33474i06A9843F424ACE0D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Drive the height selector with up and down arrows." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Drive the height selector with up and down arrows.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: The gridded data is extrapolated beyond the data points' envelope. The ends of the cross section probably go far into the extrapolated range. You'll probably want to match up the contour plot (closed, above, maybe keep it open) at height=61.5 (etc) to see what the valid range for weight would be. Even then, the contour plot is doing some linear interpolation across triangles formed by the data points. Big Class is not particularly smooth or dense, so you see a lot of weird artifacts that generate a false sense of detail, even inside the envelope of the data points.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jun 2021 15:55:23 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2021-06-11T15:55:23Z</dc:date>
    <item>
      <title>Cross section of a 2D plot</title>
      <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392449#M64266</link>
      <description>&lt;P&gt;How to I plot the variation in a 2D plot along say vertically in a 1D line plot in JMP?&lt;/P&gt;&lt;P&gt;I am coming from Matlab (an equivalent in MATLAB is something like &lt;A href="https://uk.mathworks.com/matlabcentral/fileexchange/23873-get-cross-section" target="_self"&gt;this&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:14:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392449#M64266</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-06-11T11:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cross section of a 2D plot</title>
      <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392482#M64268</link>
      <description>&lt;P&gt;Please the book in JMP Help about the &lt;A href="https://www.jmp.com/support/help/en/16.0/#page/jmp/introduction-to-profilers.shtml#" target="_self"&gt;Profilers&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 20:47:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392482#M64268</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-06-10T20:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cross section of a 2D plot</title>
      <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392637#M64283</link>
      <description>Thanks, The profilers option looks useful, but there are a lot of options. I will look into it.&lt;BR /&gt;What I was looking for is a a script based approach.&lt;BR /&gt;For a 2D plot, how to get a x-slice (for a give y-value) or a y-slice (for a given x-value). This is all I want to do at the moment.</description>
      <pubDate>Fri, 11 Jun 2021 12:17:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392637#M64283</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2021-06-11T12:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Cross section of a 2D plot</title>
      <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392674#M64287</link>
      <description>&lt;P&gt;Not sure if your 2D plot it based on points or a formula. If points, you could use graph builder to plot your target value against one dimension in your chart with a data filter to define the 'slice' in the other dimension.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_0-1623416878851.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33469iE72458A9D9F274DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_0-1623416878851.png" alt="ih_0-1623416878851.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are exploring a column formula, then I agree with&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;that the profiler is the easiest approach. Just change the value of one value and see the plot on the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_1-1623417679550.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33470i2AC78D9713CEC2D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_1-1623417679550.png" alt="ih_1-1623417679550.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below are scripts for both:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

dt = Open("$Sample_data/iris.jmp");

New Column("H1_1", Numeric, "Continuous", Format("Best", 12), Set Property("Notes", "Model NTanH(3)"), Formula(TanH(0.5 * ((-3.50407799736543) + -1.69201212624413 * :Sepal length + 4.45798369366822 * :Sepal width))), Set Property("Intermediate", 1));
New Column("H1_2", Numeric, "Continuous", Format("Best", 12), Set Property("Notes", "Model NTanH(3)"), Formula(TanH(0.5 * ((-4.34695576142641) + 0.578814453314083 * :Sepal length + -0.387699136913814 * :Sepal width))), Set Property("Intermediate", 1));
New Column("H1_3", Numeric, "Continuous", Format("Best", 12), Set Property("Notes", "Model NTanH(3)"), Formula(TanH(0.5 * ((-14.9199578715582) + 8.0363609653296 * :Sepal length + -9.32672254743267 * :Sepal width))), Set Property("Intermediate", 1));
New Column("Predicted Petal length", Numeric, "Continuous", Format("Best", 12), Set Property("Notes", "Model NTanH(3)"), Formula(9.72824082889675 + 0.825393378043811 * :H1_1 + 8.38378988028562 * :H1_2 + 1.62929374850912 * :H1_3), Set Property("Predicting", {:Petal length, Creator("Neural")}));

New Window("Plotting points",
	H List Box(
		Graph Builder(
			Size( 522, 456 ),
			Show Control Panel( 0 ),
			Variables( X( :Sepal length ), Y( :Petal length ) ),
			Elements( Points( X, Y, Legend( 295 ) ), Line( X, Y, Legend( 297 ) ) ),
			Local Data Filter(
				Add Filter(
					columns( :Sepal width ),
					Where( :Sepal width &amp;gt;= 2.9 &amp;amp; :Sepal width &amp;lt;= 3.1 )
				)
			)
		),
		Contour Plot(
			X( :Sepal width, :Sepal length ),
			Y( :Petal length ),
			Show Data Points( 0 ),
			Fill Areas( 0 ),
			Label Contours( 0 ),
			Transform( "Range Normalized" ),
			Specify Contours( Min( 2 ), Max( 6 ), N( 5 ) ),
			SendToReport(
				Dispatch(
					{},
					"1",
					ScaleBox,
					{Add Ref Line(
						{2.9, 3.1},
						"Solid",
						"Medium Dark Magenta",
						"Slice",
						1,
						0.25
					)}
				)
			)
		)
	)
);

//Profiler
Profiler(
	Y( :Predicted Petal length ),
	Profiler(
		1,
		Term Value(
			Sepal length( 6.302, Lock( 0 ), Show( 1 ) ),
			Sepal width( 3.125, Lock( 0 ), Show( 1 ) )
		)
	),
	Expand,
	SendToReport(
		Dispatch(
			{"Prediction Profiler"},
			"Profiler",
			FrameBox,
			{Frame Size( 320, 260 )}
		),
		Dispatch(
			{"Prediction Profiler"},
			"Profiler",
			FrameBox( 3 ),
			{Frame Size( 320, 260 )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updated: added column formulas for prediction column to script.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 15:14:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392674#M64287</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-06-11T15:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Cross section of a 2D plot</title>
      <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392703#M64291</link>
      <description>&lt;P&gt;Thanks. My 2D plot is based on Xdata, Ydata and Data.&lt;/P&gt;&lt;P&gt;What you show with the data filter looks promising, but I cannot seem to get it to plot slice at one Xdata value (for all Ydata values) .&lt;/P&gt;&lt;P&gt;I will keep look this side but any direction will be very helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I am on JMP13)&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 15:10:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392703#M64291</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2021-06-11T15:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cross section of a 2D plot</title>
      <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392705#M64292</link>
      <description>&lt;P&gt;Also, the contour plot (not graph builder's, use the contour platform) can save gridded data. As long as you want vertical or horizontal slices, it should be a row or column from the gridded data.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$sample_data/big class.jmp" );
// step 1: use the contour plot to get a grid of the data
cp = dt &amp;lt;&amp;lt; Contour Plot(
    X( :height, :weight ),
    Y( :age ),
    Show Data Points( 0 ),
    Fill Areas( 0 ),
    Label Contours( 0 ),
    Transform( "Range Normalized" ),
    Specify Contours( Min( 13 ), Max( 16.5 ), N( 8 ) )
);
nres = 100; // make this bigger if you think there is meaningful data there

dtGrid = cp &amp;lt;&amp;lt; generate grid( nres, nres );

cp&amp;lt;&amp;lt;closewindow;
close(dt,nosave);&lt;BR /&gt;
// step 2: make the cross section
dtGrid:height&amp;lt;&amp;lt;setModelingType(nominal);

dtGrid &amp;lt;&amp;lt; Graph Builder(
    Size( 522, 525 ),
    Show Control Panel( 0 ),
    Variables( X( :weight ), Y( :age ) ),
    Elements( Points( X, Y, Legend( 204 ) ), Smoother( X, Y, Legend( 205 ) ) ),
    Local Data Filter(
        Add Filter( columns( :height ), Where( :height == 67.5050505050505 ), Display( :height, N Items( 15 ), Find( Set Text( "" ) ) ) )
    )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Drive the height selector with up and down arrows." style="width: 821px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33474i06A9843F424ACE0D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Drive the height selector with up and down arrows." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Drive the height selector with up and down arrows.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: The gridded data is extrapolated beyond the data points' envelope. The ends of the cross section probably go far into the extrapolated range. You'll probably want to match up the contour plot (closed, above, maybe keep it open) at height=61.5 (etc) to see what the valid range for weight would be. Even then, the contour plot is doing some linear interpolation across triangles formed by the data points. Big Class is not particularly smooth or dense, so you see a lot of weird artifacts that generate a false sense of detail, even inside the envelope of the data points.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 15:55:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392705#M64292</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-06-11T15:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Cross section of a 2D plot</title>
      <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392706#M64293</link>
      <description>&lt;P&gt;Can you post some sample data and the script you have so far?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 15:22:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392706#M64293</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-06-11T15:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Cross section of a 2D plot</title>
      <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392710#M64297</link>
      <description>&lt;P&gt;Ha!&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657"&gt;@ih&lt;/a&gt;&amp;nbsp;beat me to it. I started a similar example but then I was in a meeting for three hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

dt = New Table( "Slicing",
	Add Rows( 2 ),
	New Column( "X",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [-1, 1] )
	),
	New Column( "Y",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [-1, 1] )
	),
	New Column( "Z",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula(
			100 + 25 * :X - 3 * :X ^ 2 - 15 * :Y - 5 * :Y ^ 2 - 7 * :X * :Y
		)
	)
);

dt &amp;lt;&amp;lt; Surface Plot(
	Columns( :Z ),
	Surface Color Theme( "Green to Black to Red" ),
	Surface Color Theme2( "Green to White to Red" ),
	Surface Color Theme3( "White to Black" ),
	Surface Color Theme4( "Blue to Gray to Red" ),
	Response Column Color Theme( "Blue to Green to Red" ),
	Response Column Color Theme2( "Spectral" ),
	Response Column Color Theme3( "Jet" ),
	Response Column Color Theme4( "White to Blue" ),
	Formula( "Z" ),
	Surface Color Method( "Solid", "Solid", "Solid", "Solid" ),
	SetVariableAxis( :X, Axis Data( {} ) ),
	SetVariableAxis( :Y, Axis Data( {} ) ),
	SetZAxis( :Z, Current Value( 95 ), Axis Data( {} ) ),
	SetXVariable( :X ),
	SetYVariable( :Y ),
	Iso Value( 0, 75 ),
	Frame3D( Set Rotation( -54, 0, 38 ) )
);

dt &amp;lt;&amp;lt; Profiler(
	Y( :Z ),
	Profiler(
		1,
		Term Value( X( 0, Lock( 0 ), Show( 1 ) ), Y( 0, Lock( 0 ), Show( 1 ) ) )
	),
	SendToReport(
		Dispatch(
			{"Prediction Profiler"},
			"10000",
			ScaleBox,
			{Min( 72.5 ), Max( 125.754437869822 ), Inc( 10 ), Minor Ticks( 0 )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jun 2021 16:07:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/392710#M64297</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-06-11T16:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cross section of a 2D plot</title>
      <link>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/691056#M87701</link>
      <description>&lt;P&gt;A solution is now available via&amp;nbsp;&lt;LI-MESSAGE title="Graph Builder Toolbar" uid="565466" url="https://community.jmp.com/t5/JMP-Add-Ins/Graph-Builder-Toolbar/m-p/565466#U565466" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1698354793606.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58024i3F69D05D0AC6BC6D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1698354793606.png" alt="hogi_0-1698354793606.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 21:13:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cross-section-of-a-2D-plot/m-p/691056#M87701</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-26T21:13:35Z</dc:date>
    </item>
  </channel>
</rss>

