# Vertical and Horizontal Shifts of Plots

I am trying to combine two plots in a way that the second plot will horizontally move to the point where the first one ends. So they will be touching each other at their end/starting points. I have tried some simple tricks and codes, but no success. The codes are as the followings:

Fig1 := Plot[10.9545 + Sqrt[100 - x^2]/2, {x, 0, 16}, PlotRange -> {{0, 16}, {0, 16}}];

Fig2 := Plot[Sqrt[120. - 4. x^2], {x, 0, 6}];

Show[Fig1, Fig2, DisplayFunction -> \$DisplayFunction,PlotLabel -> "Combined PPF"]


You can use Translate to translate the graphics primitives of Fig2 by a vector of your choice:

Show[Fig1, Fig2 /. l_Line :> Translate[l, {10, 0}], PlotRange -> All] (* or *)
Show[Fig1, Graphics[Translate[Fig2[[1]], {10, 0}]], PlotRange -> All]


Alternatively, you create a translated version of Fig2:

Fig3 = Plot[Sqrt[120. - 4. (x - 10)^2], {x, 10, 16}];
Show[Fig1, Fig3, PlotRange -> All]


same picture

• Thanks! Translate is the one that I have been looking for. – Ilker Aug 26 '18 at 16:53
• @Ilker, my pleasure. Thank you for the accept. – kglr Aug 26 '18 at 16:53

An alternative is to define your function as having two parts using Piecewise, and then simply plot that combined function.

f[x_] := Piecewise[{{10.9545 + Sqrt[100 - x^2]/2, 0 < x < 10},
{Sqrt[120. - 4. (x - 10)^2], 10 < x < 16}}];
Plot[f[x], {x, 0, 16}]
`