Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Plot a surface together with various types of sections of the surface
ResourceFunction["SectionPlot3D"][f,{x,xmin,xmax},{y,ymin,ymax},opts] generate a three-dimensional plot of f as a function of x and y highlighting sections specified by opts. | |
ResourceFunction["SectionPlot3D"][f,{x,xmin,xmax},{y,ymin,ymax},{{gx,gy},…},{t,tmin,tmax}}] plots the section of the surface determined by the generalized cylinders described parametrically by {{gx,gy},…},{t,tmin,tmax}. |
"ColorFunctionSection" | Automatic | specifies the color function(s) for the section |
"ColorFunctionSurface" | Automatic | specifies the color function(s) for the surface |
"CylinderBase" | Automatic | determines the z-value to which cylinders are projected |
"CylinderRange" | Automatic | determines the range of the cylinder |
"CylinderStyle" | Opacity[0.4] | specifies style for the cylinder; it ignores color specifications. |
"DrawCylinder" | True | whether to draw the cylinder |
"DrawPoint" | {} | a list of points to be included in the plot |
"DrawPointStyle" | {{Red,PointSize[Large]}} | styles to be applied to the points specified with the option "DrawPoint" |
"OSection" | {} | draws an oblique section determined by functions of the form z=f[x],z=g[y], or z=h[x,y] |
"OSectionStyle" | {{Red,Tube[.02]}} | styles to be applied to the oblique sections |
"PlotPointsSection" | 75 | specifies how many initial sample points to use in plotting sections |
PlotStyle | Opacity[0.7] | graphics directive for the style for each surface |
"SectionStyle" | {{Red,Tube[.02]}} | styles to be applied to sections defined parametrically by {gx,gy} |
"Surface" | True | whether to return the surface in the plot |
"VSection" | {} | draws vertical section(s) for a function or list of functions of the form y=f[x] or x=g[y] |
"VSectionStyle" | {{Red,Tube[.02]}} | styles to be applied to the vertical sections |
"XSection" | {} | draws vertical sections parallel to the yz-plane determined by the value or list of values of x |
"XSectionStyle" | {{Red,Tube[.02]}} | styles to be applied to the x-sections |
"YSection" | {} | draws vertical sections parallel to the xz-plane determined by the value or list of values of y |
"YSectionStyle" | {{Red,Tube[.02]}} | styles to be applied to the y-sections |
"ZSection" | {} | draws horizontal sections parallel to the xy-plane determined by the value or list of values of z |
"ZSectionStyle" | {{Red,Tube[.02]}} | styles to be applied to the z-sections |
Plot a surface with a circular section:
In[1]:= |
Out[1]= |
Plot a surface with all possible plane sections:
In[2]:= |
Out[2]= |
Plot a surface with both a plane section and a parametrically-defined section:
In[3]:= |
Out[3]= |
Plot two surfaces with their intersection illustrated with sections:
In[4]:= |
Out[4]= |
Set a style for the sections:
In[5]:= |
Out[5]= |
Set a different style for each section:
In[6]:= |
Out[6]= |
Set a style for the surface:
In[7]:= |
Out[7]= |
Set a color function for both the surface and the sections:
In[8]:= |
Out[8]= |
Set where to place the base of the cylinder:
In[9]:= |
Out[9]= |
Set the cylinder to be drawn from the top of the bounding box down to the surface:
In[10]:= |
Out[10]= |
Draw the cylinder both above and below the surface:
In[11]:= |
Out[11]= |
Draw the cylinder to full height:
In[12]:= |
Out[12]= |
Draw a cylinder from a base of -2 to the surface (this is the same as setting "CylinderBase" →-2):
In[13]:= |
Out[13]= |
"CylinderRange" takes precedence over "CylinderBase":
In[14]:= |
Out[14]= |
Apply a style to the cylinder:
In[15]:= |
Out[15]= |
Suppress the plot of the cylinder:
In[16]:= |
Out[16]= |
Add points and styles to the points:
In[17]:= |
Out[17]= |
Add oblique sections:
In[18]:= |
Out[18]= |
Add styles:
In[19]:= |
Out[19]= |
Change the number of points used to plot the section(s). Since the Wolfram Language’s plotting commands use adaptive procedures to determine how many points to actually plot, we must turn off this feature by setting the option MaxRecursion:
In[20]:= |
Out[20]= |
Apply a style to the surface:
In[21]:= |
Out[21]= |
Apply a style to the section:
In[22]:= |
Out[22]= |
Suppress the plot of the surface:
In[23]:= |
Out[23]= |
Add vertical sections:
In[24]:= |
Out[24]= |
VSections can be any function of x or y:
In[25]:= |
Out[25]= |
Set a style:
In[26]:= |
Out[26]= |
Add x-sections:
In[27]:= |
Out[27]= |
Assign a style to the x-sections:
In[28]:= |
Out[28]= |
Plot several sections and suppress the plot of the surface:
In[29]:= |
Out[29]= |
Add y-sections:
In[30]:= |
Out[30]= |
Set a style for the y-sections:
In[31]:= |
Out[31]= |
Add z-sections:
In[32]:= |
Out[32]= |
Set a style for z-sections:
In[33]:= |
Out[33]= |
SectionPlot3D only allows one color function:
In[34]:= |
Out[34]= |
If one of the sections is outside the plot range, it is removed and a warning message is given:
In[35]:= |
Out[35]= |
"CylinderStyle" does not allow a color directive:
In[36]:= |
Out[36]= |
"SectionStyle" does not allow a opacity, dashing, or thickness directives. Opacity and dashing are dropped, and thickness is replaced by Tube:
In[37]:= |
Out[37]= |
"XSectionStyle", "YSectionStyle", "ZSectionStyle", "VSectionStyle", "OSectionStyle" do not accept opacity directives:
In[38]:= |
Out[38]= |
"VSection" must be set to one or more functions of x or y, but not both:
In[39]:= |
Out[39]= |
This work is licensed under a Creative Commons Attribution 4.0 International License