# Manipulate with two graphs dependent on the same parameters

I have two functions which depend on the same parameters and I want to make a manipulate box with both of them, but I want to use one slider to control both function (so I can compare how change in a parameter affects both of them).

The easiest way would be to use Plot command with both of them inside, but they have different y axis so I cannot use it.

For now I use Panel and I have two graphs next to each other, but they have separate sliders with the same parameters.

What is the way out of this?

EXAMPLE

Panel[Manipulate[
Plot[-9.81*t, {t, 0, Sqrt[2*h/9.81]}, PlotStyle -> Red ], {h , 1,
100}] Manipulate[
Plot[h - 9.81*t^2/2, {t, 0, Sqrt[2*h/9.81]}], {h, 1, 100}] ,
FrameMargins -> 0]

• Could you add code examples. Its much easier to understand what you are talking about, and its much more likely that somebody would help you if you place code examples (properly formatted) that can be copied easily into Mathematica session. – ercegovac Feb 3 '17 at 16:08
• @ercegovac thanks for the tip! Added a simple example, as you suggested – 10001000101111 Feb 3 '17 at 16:17
• Manipulate[Row@{ Plot[a, {x, 0, 1}, PlotRange -> {0, 10}, ImageSize -> Large], Plot[2 a, {x, 0, 10}, PlotRange -> {0, 10}, ImageSize -> Large] }, {a, 0, 5} ] – grbl Feb 3 '17 at 16:18
• Thanks @grbl. What is the "@" sign for? Is it part of Row function? – 10001000101111 Feb 3 '17 at 16:24
• @lough_or_cry , you should really familiarize yourself with Mathematica and its paradigm (functional programming). In this particular case @ stands for Prefix operator (search Mathematica help, its powerful ). I'd recommend the following link it gives some useful tips and tricks to jump-start with Mathematica. – ercegovac Feb 3 '17 at 16:27

Full example of my comment:

Manipulate[
Column@{Plot[-9.81*t, {t, 0, Sqrt[2*h/9.81]}, PlotStyle -> Red,
Frame -> True,
ImagePadding -> {{30, 10}, {30, 10}}],
Plot[h - 9.81*t^2/2, {t, 0, Sqrt[2*h/9.81]}, Frame -> True,
ImagePadding -> {{30, 10}, {30, 10}}]},
{h,1, 100}]

• I have problems with adjusting the spacing between the graphs: usually I would use Column[{},Spacings -> s], but it doesn't seem to work – 10001000101111 Feb 4 '17 at 10:38

This seems to work too for your particular example.

Manipulate[Show[Plot[-9.81*t, {t, 0, Sqrt[2*h/9.81]}, PlotStyle -> Red,
Frame -> True, ImagePadding -> {{30, 10}, {30, 10}}, PlotRange -> All],
Plot[h - 9.81*t^2/2, {t, 0, Sqrt[2*h/9.81]}, Frame -> True,
ImagePadding -> {{30, 10}, {30, 10}}, PlotRange -> All]], {h, 1,100}] 