# Mathematica add line to manipulate

Manipulate[ Plot[x^2 - 2 (m - 1) x + m (m - 3), {x, -30, 30}, PlotRange -> p], {m, -10, 10, 0.25, Appearance -> "Labeled"}, {p, -50, 1500, 50, Appearance -> "Labeled"}]


I have this and am trying to add a line on the output graph with the following slope and intersection

y=-13.3871 + 0.774194 x


I've tried to add a grid line of this line, but it will only work for vertical and horizontal lines it seems.

I'd appreciate any help. Thanks

• Welcome to Mathematica SE. To get started:1) take the introductory tour now,2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge,3) remember to accept the answer, if any, that solves your problem, by clicking checkmark sign,4) give help too, by answering questions in your areas of expertise.
– user49048
Mar 5, 2022 at 0:05
• A question: if I try to execute the following I get a Plot. Can you please try it to see if this is what you want? Perhaps I misunderstood your question. The command is: Manipulate[ Plot[{x^2 - 2 (m - 1) x + m (m - 3), -13.3871 + 0.774194 x}, {x, -30, 30}, PlotRange -> p], {m, -10, 10, 0.25, Appearance -> "Labeled"}, {p, -50, 1500, 50, Appearance -> "Labeled"}]
– user49048
Mar 5, 2022 at 0:08

As an alternative the following produces the same output as the code by @cvgmt

Manipulate[  Plot[{x^2 - 2 (m - 1) x + m (m - 3), -13.3871 + 0.774194 x}, {x, -30,     30}, PlotRange -> p], {m, -10, 10, 0.25,    Appearance -> "Labeled"}, {p, -50, 1500, 50,    Appearance -> "Labeled"}]


Use Epilog to add a line InfiniteLine[{0, -13.3871}, {1, 0.774194}] with direction {1, 0.774194}.

Manipulate[
Plot[x^2 - 2 (m - 1) x + m (m - 3), {x, -30, 30}, PlotRange -> p,
Epilog -> InfiniteLine[{0, -13.3871}, {1, 0.774194}]], {m, -10, 10,
0.25, Appearance -> "Labeled"}, {p, -50, 1500, 50,
Appearance -> "Labeled"}]