Show Movable Line on a Graph

You can add an unfitted, movable line to any graph that has at least one numeric attribute.

  1. Select the graph.
  2. Click the ruler icon in the right corner of the Graph window.
  3. Check Movable Line, as shown below. You can then click and drag the line so that it goes through the points on your graph.
  4. If you decide that your line should always pass through the origin (0, 0) on the graph, choose Intercept Locked from the Ruler menu, as shown here: 

If the graph has numeric attributes on both axes, you get an oblique line, and its equation appears next to the plot. Dragging that line by its middle keeps the slope but changes the intercept (translates the line); dragging by either end changes the slope (rotates the line).

The cursor you get when you are over the line changes to tell you which kind of drag you’re about to perform.

If the graph has numeric attributes on only one axis, you get a line perpendicular to that axis, and the value of that line appears below the plot area. Drag the line (movable value) to move it, and the value updates dynamically.

  • Note: To remove a movable line, uncheck Movable Line from the contextual Ruler menu that now appears.
Was this Article Useful? 

Comments

Is there a way to access the current slope and intercept of the movable line to do computations with them? I am hoping to use them in a formula for a computed column.

Unfortunately, there is no way to access the slope and intercept of a movable line in a formula.

Is there a way to get the slope and intercept of the movable line as variables, almost like slider variable values, to use in computing a formula for a computed column?

Here’s an idea. Create two sliders, let’s say named m and b. Now, in the scatterplot, using the Ruler menu, choose Plotted Function. Click in the function area at the top of the plot and enter m*x+b. (Or, if you like, you can use the name of the attribute on the x axis; e.g. m*Height+b). When you press Apply you’ll see your line (assuming your axis bounds permit). The two sliders will control the line and you can use them in formulas elsewhere.

I wanted to be able to fix a point on the line when I changed the slope, for example fixing a candidate regression line at the mean-mean point. I think I have a working model of how the line works. The middle handle translates up and down as advertised. Grabbing an end handle rotates the line, but watch where you take your cursor; what ever point pt your cursor stops at, using the other end handle will rotate around that point pt. This is why sometimes the graph rotates around an end handle and sometimes not, it is all according if the end handle from the last drag could follow and stop where your cursor does. I have also notice that a drag off the window ends up in a rotation point at the boundary.
Can I get verification that (1) I am being clear, and if so, (2) this is correct. It would be really worthwhile (imo) to make this feature clear in the help. Or more embarrassingly, this is explained and I missed it. Thanks!

Your very clear explanation of what you have discovered is completely correct. If you wouldn’t mind posting your question in the CODAP Help forum (https://codap.concord.org/forums/forum/test/) then at least we would have your documentation of how dragging the movable line works ;)

Add new comment

Comments are closed for the CODAP Help site. If you have a question or problem, please post on the CODAP Help Forum instead. Thank you.