Vertical and Horizontal Shifts of Plots

The name of the pictureThe name of the pictureThe name of the pictureClash 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"]


enter image description here










share|improve this question

























    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"]


    enter image description here










    share|improve this question























      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"]


      enter image description here










      share|improve this question













      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"]


      enter image description here







      plotting






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 26 at 16:16









      Ilker

      623




      623




















          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]


          enter image description here



          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







          share|improve this answer






















          • 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

















          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]


          enter image description here






          share|improve this answer




















            Your Answer




            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            );
            );
            , "mathjax-editing");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "387"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            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






























            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]


            enter image description here



            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







            share|improve this answer






















            • 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














            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]


            enter image description here



            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







            share|improve this answer






















            • 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












            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]


            enter image description here



            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







            share|improve this answer














            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]


            enter image description here



            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








            share|improve this answer














            share|improve this answer



            share|improve this answer








            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
















            • 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










            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]


            enter image description here






            share|improve this answer
























              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]


              enter image description here






              share|improve this answer






















                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]


                enter image description here






                share|improve this answer












                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]


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 27 at 2:03









                bill s

                51.2k373145




                51.2k373145



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    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













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay