Vertical and Horizontal Shifts of Plots
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
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"]
plotting
add a comment |Â
up vote
4
down vote
favorite
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"]
plotting
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
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"]
plotting
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"]
plotting
plotting
asked Aug 26 at 16:16
Ilker
623
623
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
6
down vote
accepted
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 at 16:53
`@Ilker, my pleasure. Thank you for the accept.
â kglr
Aug 26 at 16:53
add a comment |Â
up vote
3
down vote
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]
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
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 at 16:53
`@Ilker, my pleasure. Thank you for the accept.
â kglr
Aug 26 at 16:53
add a comment |Â
up vote
6
down vote
accepted
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 at 16:53
`@Ilker, my pleasure. Thank you for the accept.
â kglr
Aug 26 at 16:53
add a comment |Â
up vote
6
down vote
accepted
up vote
6
down vote
accepted
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
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
edited Aug 28 at 3:53
answered Aug 26 at 16:41
kglr
161k8185385
161k8185385
Thanks! Translate is the one that I have been looking for.
â Ilker
Aug 26 at 16:53
`@Ilker, my pleasure. Thank you for the accept.
â kglr
Aug 26 at 16:53
add a comment |Â
Thanks! Translate is the one that I have been looking for.
â Ilker
Aug 26 at 16:53
`@Ilker, my pleasure. Thank you for the accept.
â kglr
Aug 26 at 16:53
Thanks! Translate is the one that I have been looking for.
â Ilker
Aug 26 at 16:53
Thanks! Translate is the one that I have been looking for.
â Ilker
Aug 26 at 16:53
`@Ilker, my pleasure. Thank you for the accept.
â kglr
Aug 26 at 16:53
`@Ilker, my pleasure. Thank you for the accept.
â kglr
Aug 26 at 16:53
add a comment |Â
up vote
3
down vote
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]
add a comment |Â
up vote
3
down vote
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]
add a comment |Â
up vote
3
down vote
up vote
3
down vote
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]
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]
answered Aug 27 at 2:03
bill s
51.2k373145
51.2k373145
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f180692%2fvertical-and-horizontal-shifts-of-plots%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password