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 >

Line

Updated In 7 Graphic
Line[{pt1, pt2, ...}]
is a graphics primitive which represents a line joining a sequence of points.
Line[{{pt11, pt12, ...}, {pt21, ...}, ...}]
represents a collection of lines.
  • The positions of points can be specified either in ordinary coordinates, as {x, y} or {x, y, z}, or in scaled coordinates as Scaled[{x, y}] or Scaled[{x, y, z}].  »
  • Offset can be used to specify coordinates in two dimensions.  »
  • The line consists of a sequence of straight segments joining the specified points.
  • The option VertexColors->{c1, c2, ...} can be used to specify that the color of the line should interpolate between colors ci specified for each point.
  • In 3D, the option VertexNormals->{n1, n2, ...} can be used to specify effective normals at each point, to be interpolated for purposes of smooth shading.
  • Joining of line segments can be specified using JoinForm.
  • Line caps can be specified using CapForm.
  • Individual coordinates and lists of coordinates in lines can be Dynamic objects.
A line primitive:
Differently styled 2D lines:
Differently styled 3D lines:
Single line segment:
Multiple connected line segments:
Multiple disconnected line segments:
Lines with different thicknesses:
Thickness in scaled size:
Thickness in printer's points:
Dashed lines:
Colored lines:
Line caps can be specified using CapForm:
Joining of line segments can be specified using JoinForm:
Colors can be specified at vertices using VertexColors:
Normals can be specified at vertices using VertexNormals for 3D lines:
Use Scaled coordinates:
Use ImageScaled coordinates in 2D:
Use Offset coordinates in 2D:
Line with vertex colors:
Specify vertex colors for 3D lines:
Specify vertex normals for 3D lines:
Complete graph with 11 nodes:
The tangent bundle for a quadratic curve:
A vector field:
2D random walk on a regular lattice:
3D random walk on a regular lattice:
Replace Polygon with Line to have special rendering effects:
Use a random collection of light sources:
Several visualization functions produce Line objects:
Use directive styles appropriate for lines:
You can also transform the output:
The same idea applies in 3D:
This shows the points at which it was sampled:
Line objects need to be specified using numbers that can be represented by machine numbers:
A random collection of lines:
Lines with lighting:
Moiré pattern:
Tangent vectors along an elliptic curve:
New in 1 | Last modified in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team