This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.

- JMP User Community
- :
- Blogs
- :
- Uncharted
- :
- 3D Plot and 2D cross-section

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.

Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.

Article Options

- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content

3D Plot and 2D cross-section

Created:
Dec 10, 2020 12:44 PM

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);
)
);
```

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 ) ) )}
)
)
);
```

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( "" )} ) )
);
```

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.

- © 2024 JMP Statistical Discovery LLC. All Rights Reserved.
- Terms of Use
- Privacy Statement
- About JMP
- JMP Software
- JMP User Community
- Contact

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.