Function Repository Resource:

# GraphPaperGridLines

Generate grid lines in graphics in the style of traditional graph paper

Contributed by: Jon McLoone
 ResourceFunction["GraphPaperGridLines"][{{xlo,xhi},{ylo,hi}}] creates the GridLines option for graph paper style lines over the range given by xlo,xhi,ylo,yhi. ResourceFunction["GraphPaperGridLines"][gr] shows the Graphics object gr with GridLines in the style of graph paper.

## Details and Options

The primary subdivisions are chosen to be the largest power of 10 that allows at least two primary GridLines.
ResourceFunction["GraphPaperGridLines"] supports the following options:
 "PrimaryStyle" Gray the style for major grid lines. "SecondaryStyle" LightGray the style for minor grid lines. "SecondaryCount" 5 the number of subdivisions between each major grid line

## Examples

### Basic Examples (2)

Show a plot with graph paper style GridLines:

 In[1]:=
 Out[1]=

Generate the option value to give this effect:

 In[2]:=
 Out[2]=
 In[3]:=
 Out[3]=

### Options (2)

You can change the style of both the primary and secondary GridLines:

 In[4]:=
 Out[4]=

You can change how many subdivisions there are between each primary grid line. Typically values will be 2, 5 or 10:

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=

### Properties and Relations (2)

When applied to a Graphics object, the PlotRange of the object is used to calculate the grid:

 In[7]:=
 Out[7]=

This is equivalent to:

 In[8]:=
 Out[8]=

### Possible Issues (2)

If used within functions with a HoldAll attribute, it is necessary to use Evaluate:

 In[9]:=
 Out[9]=
 In[10]:=
 Out[10]=

GridLines are equally spaced in the x and y directions, so if AspectRatio is not Automatic, the spacings will then appear different in the different directions:

 In[11]:=
 Out[11]=

Jon McLoone

## Version History

• 1.0.0 – 25 May 2021