Skip to content

Add a movable line

Add a movable line to a scatterplot so students can eyeball a linear fit to the data.

How-to guide

Last reviewed: November 2024

Students can work with the Tuva movable line to begin eyeballing an estimation of a linear fit. Using the moveable line tool, students can easily stretch and drag a line to approximate data.

The process of creating a movable line to fit bivariate linear data is fairly simple. 

Step 1: Create a Scatterplot

Drag numerical attributes to each of the x- and y-axes.

A scatter plot of distance covered against number of revolutions with arrows pointing to the x- and y-axis drop targets

Step 2: Add the Moveable Line

Click on Model Data in the toolbar to open the dropdown menu.

From the dropdown, choose Movable Line — Add Movable Line on X-Y.

This will add an unfitted, movable line on the scatterplot.

The Model Data dropdown menu open with Movable Line submenu showing Add Movable Line on X-Y

If you would like to change the color of the line, click on the small grid icon (Context menu) next to the X when the line is highlighted. 

A highlighted movable line on the scatter plot with the context menu icon called out next to the X

From the menu, click on the circle next to Color to open the color picker and select the color you like.

The line color picker open with the color circle, default palette, and gradient and hue sliders labeled

If you chose the default red, your graph will look something like this.

A red movable line drawn through the scatter plot points after choosing the default color

Step 3: Adjusting the Line

Drag the line by its middle to translate the line (shift up, down, left, or right). This changes the intercept.

An arrow showing the movable line being dragged by its middle to shift the intercept

Drag by the handles at either end to rotate the line or change the slope.

Arrows showing the movable line's end handles being dragged up or down to change the slope

Drag either handle along the slope of the line to stretch the line.

Arrows showing the movable line's end handles being pulled outward to stretch the line

The parameters of the line get updated dynamically as you drag the movable line in search of a good fit.

Step 4: Finding the Right Fit

Continue to tweak the line until it seems to fit the data. The fitted graph will look somewhat like this:

The movable line adjusted to closely fit through all the scatter plot points

When you hover on the line, the equation of the line will appear, and you can start making sense of the equation and parameters in the context of your data.

Was this page helpful?