# How to show a line in a Manipulate plot?

I'm trying to display a Graphics line alongside my Manipulate plot but I can't seem to do it because the Graphics and the Plot do not show up together.

Basically, I want to show this line

Graphics[{Dashed,Line[{{0,2974.83},{10,2974.83}}]}]


inside my Manipulate Plot where my Plot will be interactive and the line will also be there.

Here is my Manipulate Plot if that is helpful:

Manipulate[
Plot[((5949.66-(0.669207*(471-bd)+0.068928*(bd)))/-10*t+5949.66),{t,0,10},
AxesLabel->{"years from now", "billion Kg CO2eq"},
PlotRange->All],
{{bd,0,"Beef (dairy herd) factories converted"},0,417}
]


I have attached a picture of what I would want it to look like. I am pretty new to the software so any help would be greatly appreciated! Please let me know if I have mixed up something or need to clarify. Thanks!

• see the examples in Show and in Epilog – kglr Dec 2 '20 at 22:53
• see also GridLines – kglr Dec 2 '20 at 22:53
• Epilog -> {Dashed, Line[{{0, 2974.83}, {10, 2974.83}}]} – cvgmt Dec 3 '20 at 1:57

## 1 Answer

Try adding GridLines to the Plot and a Control to move it up and down:

Manipulate[
Plot[
((5949.66 - (0.669207*(471 - bd) + 0.068928*(bd)))/-10*t +
5949.66),
{t, 0, 10},
AxesLabel -> {"years from now", "billion Kg CO2eq"},
PlotRange -> All,
GridLines -> {None, {{gl, Dashed}}}
],

{{bd, 0, "Beef (dairy herd) factories converted"}, 0, 417},
{{gl, 1000, "GridLine"}, 500, 6000}
] 