Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Visualization and Graphics > Symbolic Graphics Language > Graphics Objects >

Cylinder

Updated In 7 Graphic
Cylinder[{{x1, y1, z1}, {x2, y2, z2}}, r]
represents a cylinder of radius r around the line from (x1, y1, z1) to (x2, y2, z2).
Cylinder[{{x1, y1, z1}, {x2, y2, z2}}]
represents a cylinder of radius 1.
  • Cylinder represents the whole filled cylinder, not just the surface.
  • The ends of the cylinder are disks.
  • The cylinder radius can be specified either in absolute coordinates, or as Scaled[s].
  • Colors and other material properties of cylinders can be specified using color directives as well as Specularity and Glow.  »
  • Cylinders can be specified as transparent using Opacity directives.  »
  • Cylinder[{spec1, spec2, ...}] represents a collection of cylinders of radius 1.
  • Cylinder[{spec1, spec2, ...}, r] represents a collection of cylinders of radius r.
  • Cylinder[{spec1, spec2, ...}, {r1, r2, ...}] represents a collection of cylinders with specifications speci and radii ri.
A unit radius and unit height cylinder:
A cylinder from the origin to {1, 1, 1} with radius 1/2:
Differently styled cylinders:
A unit radius and unit height cylinder:
In[1]:=
Click for copyable input
Out[1]=
A cylinder from the origin to {1, 1, 1} with radius 1/2:
In[2]:=
Click for copyable input
Out[2]=
 
Differently styled cylinders:
In[1]:=
Click for copyable input
Out[1]=
If no radius is specified, it is assumed to be 1:
Cylinders with different radii:
Cylinders with different directions:
Short form for a cylinder centered at the origin with a radius 1:
Use Scaled coordinates:
Use Scaled radius:
Multiple cylinders:
Color directives specify the face colors of cylinders:
FaceForm and EdgeForm can be used to specify the styles of the faces and edges:
Different properties can be specified for the front and back faces using FaceForm:
Cylinders with different specular exponents:
White cylinder that glows red:
Opacity specifies the face opacity:
Platonic polyhedra:
A simple 3D bar chart:
Use Cylinder to render edges in a GraphPlot3D:
Define a ChartElementFunction based on Cylinder:
BarChart3D use Cylinder to produce 3D bar charts:
Histogram3D can similarly use Cylinder:
Use Cylinder to display bubbles in BubbleChart3D:
Use Scale to get elliptical cylinders:
A parametric specification of a cylinder shell generated using ParametricPlot3D:
An implicit specification of a cylinder shell generated by ContourPlot3D:
ChemicalData plots a molecule using spheres and cylinders:
Random unit cylinders:
Nested transparent cylinders:
New in 6 | Last modified in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team