This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Graphics and Sound / Basic Options  /
GridLines

  • GridLines is an option for two-dimensional graphics functions that specifies grid lines.
  • The following settings can be given for GridLines:
  • With the Automatic setting, grid lines are usually placed at points whose coordinates have the minimum number of digits in their decimal representation.
  • For each direction, the following grid line options can be given:
  • Grid line styles can involve graphics directives such as RGBColor and Thickness.
  • Grid lines are by default colored light blue.
  • The grid line function func [ xmin , xmax ] may return any other grid line option.
  • FullOptions gives the explicit form of GridLines specifications when Automatic settings are used.
  • See the Mathematica book: Section 1.9.3, Section 2.9.5Section 2.9.5.
  • See also: Ticks, FrameTicks, FaceGrids, ColumnLines, RowLines.

    Further Examples

    This gives a plot with grid lines in both the vertical and horizontal directions.

    Evaluate the cell to see the graphic.

    In[1]:=

    This plot specifies the grid lines in the vertical direction explicitly and lets Mathematica compute the horizontal lines automatically.

    Evaluate the cell to see the graphic.

    In[2]:=