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
Craige_Hales
Super User
3D Plot and 2D cross-section

Radiation pattern asked for some specialized graphs. Here are some approximations. First, make some data that represents a blobby surface around 0,0,0. In the original question, this might represent the signal response of an antenna in all directions. Larger radius values might represent higher gain in that direction. The JSL converts polar data to rectangular data. If you have a formula, you can get as many points as you need; the graph needs a lot to hide the points in the rear. If you have a few actual measurements, something will need to generate the in-between points (maybe fit model?)

// make some blobby data
dt=New Table( "Untitled 3",
	New Column( "x", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "y", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "z", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "radius", Numeric, "Continuous", Format( "Best", 12 ) )
);
for(lat=-80, lat<=80,lat+=2,
	rLat = 2*pi()*lat/360;
	for(lon=-180, lon<180,lon+=2,
		rLon = 2*pi()*lon/360;
		dt<<addrows(1);
		dt:radius = 1+(sin(rLat*2)*sin(rLon*3));
		dt:x = dt:radius * cos(rLat) * sin(rLon);
		dt:y = dt:radius * cos(rLat) * cos(rLon);
		dt:z = dt:radius * sin(rLat);
	)
);

x.y.z data with redundant radiusx.y.z data with redundant radius

 

Next make the 3D graph. This is using a lot of points, and making their size large to get the effect of a solid surface. The redundant radius is used for the coloring.

// display the 3D data
dt<<Scatterplot 3D(
	Y( :x, :y, :z ),
	Coloring( :radius ), // radius is 
	Legend( 41 ),
	Frame3D(
		Set Graph Size( 785, 708 ),
		Legend( 1 ),
		Set Grab Handles( 0 ),
		Set Rotation( -160, -60, -117 ),
		// the next two make the markers large enough to hide the markers behind them
		Set Marker Quality( 0.1098 ),
		Set Marker Scale( 5.05 )
	),
	SendToReport(
		Dispatch(
			{},
			"100",
			ScaleBox,
			// you can make a custom theme if needed
			{Legend Model( 41, Properties( 0, {gradient( {Color Theme( "Blue to Green to Red" )} )}, Item ID( "radius", 1 ) ) )}
		)
	)
);

3D looks much better when the mouse is used to rotate the graph!3D looks much better when the mouse is used to rotate the graph!

 

And finally, make a cross-section.

// make a slice; this is the x-y plane at z -1.2
dt<<Graph Builder(
	Size( 514, 444 ),
	Show Control Panel( 0 ),
	Variables( X( :x ), Y( :y ) ),
	Elements( Points( X, Y, Legend( 350 ) ), Smoother( X, Y, Legend( 351 ) ) ),
	Local Data Filter(
		Add Filter( columns( :z ), Where( :z >= -1.3659 & :z <= -1.1351 ) )
	),
	SendToReport( Dispatch( {}, "400", LegendBox, {Set Title( "" )} ) )
);

You can make it more or less fuzzy with the data filter's z selection.You can make it more or less fuzzy with the data filter's z selection.

 

That could be done on the y-z or x-z plane as well. If you need the circular compass rose, you can add a graphic script.

 

 

Last Modified: Dec 11, 2020 6:12 AM