The Line( Command

Command Summary

Draws a line at any angle.

Command Syntax


Menu Location


  1. 2nd DRAW to enter the draw menu
  2. 2 to insert the Line( token, or use arrows and ENTER.

Calculator Compatibility


Token Size

1 byte

The Line( command is used to draw lines at any angle, as opposed to only drawing vertical or horizontal lines. Line(X1,Y1,X2,Y2) will draw a line from (X1,Y1) to (X2,Y2). Line( is affected by the window settings, although you can use a friendly window so there is no impact on the command.


Advanced Uses

Line has an optional fifth argument. It can be any real number, but the default is one. If the fifth argument, erase, is something other than 0, then it will simply draw the line. If erase is 0, then it will erase the line.


Leave off the ending argument if you are just drawing the line.

can be

The ending argument can be a formula, which is useful for movement applications and other things such as health bars where the lines drawn are constantly different. The following draws or erases a line depending on whether a key is pressed.


If working on a TI 84+CSE or TI 84+CE, then the fifth argument of the Line( command can be a color name or ID number:


The last argument, line style, is an optional argument that chooses what style of line to draw on the color calculators.

1 pixel wide line
2 pixel wide line
shaded above
shaded below

Command Timings

If you are drawing horizontal or vertical lines that stretch the entire graph screen, such as a border, it is better to use Vertical or Horizontal. These are smaller and are usually faster as well.

Related Commands

See Also


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License