Vertical and Horizontal Shifts of Plots










4












$begingroup$


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









$endgroup$
















    4












    $begingroup$


    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









    $endgroup$














      4












      4








      4





      $begingroup$


      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









      $endgroup$




      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 '18 at 16:16









      IlkerIlker

      623




      623




















          2 Answers
          2






          active

          oldest

          votes


















          6












          $begingroup$

          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











          $endgroup$












          • $begingroup$
            Thanks! Translate is the one that I have been looking for.
            $endgroup$
            – Ilker
            Aug 26 '18 at 16:53










          • $begingroup$
            `@Ilker, my pleasure. Thank you for the accept.
            $endgroup$
            – kglr
            Aug 26 '18 at 16:53


















          3












          $begingroup$

          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









          $endgroup$












            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            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















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            6












            $begingroup$

            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











            $endgroup$












            • $begingroup$
              Thanks! Translate is the one that I have been looking for.
              $endgroup$
              – Ilker
              Aug 26 '18 at 16:53










            • $begingroup$
              `@Ilker, my pleasure. Thank you for the accept.
              $endgroup$
              – kglr
              Aug 26 '18 at 16:53















            6












            $begingroup$

            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











            $endgroup$












            • $begingroup$
              Thanks! Translate is the one that I have been looking for.
              $endgroup$
              – Ilker
              Aug 26 '18 at 16:53










            • $begingroup$
              `@Ilker, my pleasure. Thank you for the accept.
              $endgroup$
              – kglr
              Aug 26 '18 at 16:53













            6












            6








            6





            $begingroup$

            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











            $endgroup$



            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 '18 at 3:53

























            answered Aug 26 '18 at 16:41









            kglrkglr

            182k10200414




            182k10200414











            • $begingroup$
              Thanks! Translate is the one that I have been looking for.
              $endgroup$
              – Ilker
              Aug 26 '18 at 16:53










            • $begingroup$
              `@Ilker, my pleasure. Thank you for the accept.
              $endgroup$
              – kglr
              Aug 26 '18 at 16:53
















            • $begingroup$
              Thanks! Translate is the one that I have been looking for.
              $endgroup$
              – Ilker
              Aug 26 '18 at 16:53










            • $begingroup$
              `@Ilker, my pleasure. Thank you for the accept.
              $endgroup$
              – kglr
              Aug 26 '18 at 16:53















            $begingroup$
            Thanks! Translate is the one that I have been looking for.
            $endgroup$
            – Ilker
            Aug 26 '18 at 16:53




            $begingroup$
            Thanks! Translate is the one that I have been looking for.
            $endgroup$
            – Ilker
            Aug 26 '18 at 16:53












            $begingroup$
            `@Ilker, my pleasure. Thank you for the accept.
            $endgroup$
            – kglr
            Aug 26 '18 at 16:53




            $begingroup$
            `@Ilker, my pleasure. Thank you for the accept.
            $endgroup$
            – kglr
            Aug 26 '18 at 16:53











            3












            $begingroup$

            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









            $endgroup$

















              3












              $begingroup$

              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









              $endgroup$















                3












                3








                3





                $begingroup$

                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









                $endgroup$



                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 '18 at 2:03









                bill sbill s

                53.1k375150




                53.1k375150



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Mathematica Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    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















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

                    Crossroads (UK TV series)

                    ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế