How to reverse X-axis in Graphics?












4












$begingroup$


The following



Graphics[Circle, Axes -> {True, True}, ScalingFunctions -> {Identity, "Reverse"}]


doesn't work



enter image description here



I need "minus" direction go to the right...










share|improve this question









$endgroup$

















    4












    $begingroup$


    The following



    Graphics[Circle, Axes -> {True, True}, ScalingFunctions -> {Identity, "Reverse"}]


    doesn't work



    enter image description here



    I need "minus" direction go to the right...










    share|improve this question









    $endgroup$















      4












      4








      4





      $begingroup$


      The following



      Graphics[Circle, Axes -> {True, True}, ScalingFunctions -> {Identity, "Reverse"}]


      doesn't work



      enter image description here



      I need "minus" direction go to the right...










      share|improve this question









      $endgroup$




      The following



      Graphics[Circle, Axes -> {True, True}, ScalingFunctions -> {Identity, "Reverse"}]


      doesn't work



      enter image description here



      I need "minus" direction go to the right...







      plotting graphics






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 10 at 11:14









      DimsDims

      30117




      30117






















          2 Answers
          2






          active

          oldest

          votes


















          6












          $begingroup$

          For Circle (or any graphics primitive symmetric around the origin), you can use custom ticks:



          Graphics[Circle, 
          Axes -> True, TicksStyle -> 16,
          Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]


          enter image description here



          You can also cheat by using the graphics primitives as Epilog in a plotting function that accepts ScalingFunctions(say, Plot):



          Plot[x, {x, -1, 1}, AspectRatio -> 1, TicksStyle -> 16, 
          PlotStyle -> None,
          PlotRange -> {{-1, 1}, {-1, 1}}, Axes -> True,
          ScalingFunctions -> {"Reverse", Identity},
          Epilog -> {Circle}, ]


          enter image description here



          In general, you can use ScalingTransform[{-1, 1}] or ReflectionTransform[{-1, 0}] on graphics primitives and use custom ticks:



          SeedRandom[1]
          pnts = RandomReal[{-5, 5}, {10, 2}];
          Row[{Graphics[{Opacity[.5], Blue,
          Polygon[pnts[[FindShortestTour[pnts][[2]]]]]},
          Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300],
          Graphics[{Opacity[.5], Green,
          GeometricTransformation[
          Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
          Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300]
          Graphics[{Opacity[.5], Red,
          GeometricTransformation[
          Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
          Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300,
          Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]}]


          enter image description here






          share|improve this answer











          $endgroup$













          • $begingroup$
            So it is not possible without cheating? Send shame to Stephen!
            $endgroup$
            – Dims
            Feb 10 at 12:30










          • $begingroup$
            @Dims, I think it is not possible to use the option ScalingFunctions in Graphics.
            $endgroup$
            – kglr
            Feb 10 at 12:35



















          1












          $begingroup$

          For objects like circles that are readily converted to mathematical functions:



          r = 1;

          ContourPlot[
          x^2 + y^2 == r^2,
          {x, -1.05, 1.05}, {y, -1.05, 1.05},
          Frame -> False,
          Axes -> True,
          ScalingFunctions -> {"Reverse", Identity}]


          enter image description here



          Or



          Plot[
          {Sqrt[r^2 - x^2], -Sqrt[r^2 - x^2]},
          {x, -1.05, 1.05},
          PlotStyle -> ColorData[97][1],
          AspectRatio -> 1,
          ScalingFunctions -> {"Reverse", Identity}]





          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%2f191234%2fhow-to-reverse-x-axis-in-graphics%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$

            For Circle (or any graphics primitive symmetric around the origin), you can use custom ticks:



            Graphics[Circle, 
            Axes -> True, TicksStyle -> 16,
            Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]


            enter image description here



            You can also cheat by using the graphics primitives as Epilog in a plotting function that accepts ScalingFunctions(say, Plot):



            Plot[x, {x, -1, 1}, AspectRatio -> 1, TicksStyle -> 16, 
            PlotStyle -> None,
            PlotRange -> {{-1, 1}, {-1, 1}}, Axes -> True,
            ScalingFunctions -> {"Reverse", Identity},
            Epilog -> {Circle}, ]


            enter image description here



            In general, you can use ScalingTransform[{-1, 1}] or ReflectionTransform[{-1, 0}] on graphics primitives and use custom ticks:



            SeedRandom[1]
            pnts = RandomReal[{-5, 5}, {10, 2}];
            Row[{Graphics[{Opacity[.5], Blue,
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300],
            Graphics[{Opacity[.5], Green,
            GeometricTransformation[
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300]
            Graphics[{Opacity[.5], Red,
            GeometricTransformation[
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300,
            Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]}]


            enter image description here






            share|improve this answer











            $endgroup$













            • $begingroup$
              So it is not possible without cheating? Send shame to Stephen!
              $endgroup$
              – Dims
              Feb 10 at 12:30










            • $begingroup$
              @Dims, I think it is not possible to use the option ScalingFunctions in Graphics.
              $endgroup$
              – kglr
              Feb 10 at 12:35
















            6












            $begingroup$

            For Circle (or any graphics primitive symmetric around the origin), you can use custom ticks:



            Graphics[Circle, 
            Axes -> True, TicksStyle -> 16,
            Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]


            enter image description here



            You can also cheat by using the graphics primitives as Epilog in a plotting function that accepts ScalingFunctions(say, Plot):



            Plot[x, {x, -1, 1}, AspectRatio -> 1, TicksStyle -> 16, 
            PlotStyle -> None,
            PlotRange -> {{-1, 1}, {-1, 1}}, Axes -> True,
            ScalingFunctions -> {"Reverse", Identity},
            Epilog -> {Circle}, ]


            enter image description here



            In general, you can use ScalingTransform[{-1, 1}] or ReflectionTransform[{-1, 0}] on graphics primitives and use custom ticks:



            SeedRandom[1]
            pnts = RandomReal[{-5, 5}, {10, 2}];
            Row[{Graphics[{Opacity[.5], Blue,
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300],
            Graphics[{Opacity[.5], Green,
            GeometricTransformation[
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300]
            Graphics[{Opacity[.5], Red,
            GeometricTransformation[
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300,
            Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]}]


            enter image description here






            share|improve this answer











            $endgroup$













            • $begingroup$
              So it is not possible without cheating? Send shame to Stephen!
              $endgroup$
              – Dims
              Feb 10 at 12:30










            • $begingroup$
              @Dims, I think it is not possible to use the option ScalingFunctions in Graphics.
              $endgroup$
              – kglr
              Feb 10 at 12:35














            6












            6








            6





            $begingroup$

            For Circle (or any graphics primitive symmetric around the origin), you can use custom ticks:



            Graphics[Circle, 
            Axes -> True, TicksStyle -> 16,
            Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]


            enter image description here



            You can also cheat by using the graphics primitives as Epilog in a plotting function that accepts ScalingFunctions(say, Plot):



            Plot[x, {x, -1, 1}, AspectRatio -> 1, TicksStyle -> 16, 
            PlotStyle -> None,
            PlotRange -> {{-1, 1}, {-1, 1}}, Axes -> True,
            ScalingFunctions -> {"Reverse", Identity},
            Epilog -> {Circle}, ]


            enter image description here



            In general, you can use ScalingTransform[{-1, 1}] or ReflectionTransform[{-1, 0}] on graphics primitives and use custom ticks:



            SeedRandom[1]
            pnts = RandomReal[{-5, 5}, {10, 2}];
            Row[{Graphics[{Opacity[.5], Blue,
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300],
            Graphics[{Opacity[.5], Green,
            GeometricTransformation[
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300]
            Graphics[{Opacity[.5], Red,
            GeometricTransformation[
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300,
            Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]}]


            enter image description here






            share|improve this answer











            $endgroup$



            For Circle (or any graphics primitive symmetric around the origin), you can use custom ticks:



            Graphics[Circle, 
            Axes -> True, TicksStyle -> 16,
            Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]


            enter image description here



            You can also cheat by using the graphics primitives as Epilog in a plotting function that accepts ScalingFunctions(say, Plot):



            Plot[x, {x, -1, 1}, AspectRatio -> 1, TicksStyle -> 16, 
            PlotStyle -> None,
            PlotRange -> {{-1, 1}, {-1, 1}}, Axes -> True,
            ScalingFunctions -> {"Reverse", Identity},
            Epilog -> {Circle}, ]


            enter image description here



            In general, you can use ScalingTransform[{-1, 1}] or ReflectionTransform[{-1, 0}] on graphics primitives and use custom ticks:



            SeedRandom[1]
            pnts = RandomReal[{-5, 5}, {10, 2}];
            Row[{Graphics[{Opacity[.5], Blue,
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300],
            Graphics[{Opacity[.5], Green,
            GeometricTransformation[
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300]
            Graphics[{Opacity[.5], Red,
            GeometricTransformation[
            Polygon[pnts[[FindShortestTour[pnts][[2]]]]], ScalingTransform[{-1, 1}]]},
            Axes -> {True, True}, TicksStyle -> 16, ImageSize -> 300,
            Ticks -> {Charting`ScaledTicks["Reverse"], Automatic}]}]


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 10 at 12:37

























            answered Feb 10 at 11:43









            kglrkglr

            190k10206424




            190k10206424












            • $begingroup$
              So it is not possible without cheating? Send shame to Stephen!
              $endgroup$
              – Dims
              Feb 10 at 12:30










            • $begingroup$
              @Dims, I think it is not possible to use the option ScalingFunctions in Graphics.
              $endgroup$
              – kglr
              Feb 10 at 12:35


















            • $begingroup$
              So it is not possible without cheating? Send shame to Stephen!
              $endgroup$
              – Dims
              Feb 10 at 12:30










            • $begingroup$
              @Dims, I think it is not possible to use the option ScalingFunctions in Graphics.
              $endgroup$
              – kglr
              Feb 10 at 12:35
















            $begingroup$
            So it is not possible without cheating? Send shame to Stephen!
            $endgroup$
            – Dims
            Feb 10 at 12:30




            $begingroup$
            So it is not possible without cheating? Send shame to Stephen!
            $endgroup$
            – Dims
            Feb 10 at 12:30












            $begingroup$
            @Dims, I think it is not possible to use the option ScalingFunctions in Graphics.
            $endgroup$
            – kglr
            Feb 10 at 12:35




            $begingroup$
            @Dims, I think it is not possible to use the option ScalingFunctions in Graphics.
            $endgroup$
            – kglr
            Feb 10 at 12:35











            1












            $begingroup$

            For objects like circles that are readily converted to mathematical functions:



            r = 1;

            ContourPlot[
            x^2 + y^2 == r^2,
            {x, -1.05, 1.05}, {y, -1.05, 1.05},
            Frame -> False,
            Axes -> True,
            ScalingFunctions -> {"Reverse", Identity}]


            enter image description here



            Or



            Plot[
            {Sqrt[r^2 - x^2], -Sqrt[r^2 - x^2]},
            {x, -1.05, 1.05},
            PlotStyle -> ColorData[97][1],
            AspectRatio -> 1,
            ScalingFunctions -> {"Reverse", Identity}]





            share|improve this answer









            $endgroup$


















              1












              $begingroup$

              For objects like circles that are readily converted to mathematical functions:



              r = 1;

              ContourPlot[
              x^2 + y^2 == r^2,
              {x, -1.05, 1.05}, {y, -1.05, 1.05},
              Frame -> False,
              Axes -> True,
              ScalingFunctions -> {"Reverse", Identity}]


              enter image description here



              Or



              Plot[
              {Sqrt[r^2 - x^2], -Sqrt[r^2 - x^2]},
              {x, -1.05, 1.05},
              PlotStyle -> ColorData[97][1],
              AspectRatio -> 1,
              ScalingFunctions -> {"Reverse", Identity}]





              share|improve this answer









              $endgroup$
















                1












                1








                1





                $begingroup$

                For objects like circles that are readily converted to mathematical functions:



                r = 1;

                ContourPlot[
                x^2 + y^2 == r^2,
                {x, -1.05, 1.05}, {y, -1.05, 1.05},
                Frame -> False,
                Axes -> True,
                ScalingFunctions -> {"Reverse", Identity}]


                enter image description here



                Or



                Plot[
                {Sqrt[r^2 - x^2], -Sqrt[r^2 - x^2]},
                {x, -1.05, 1.05},
                PlotStyle -> ColorData[97][1],
                AspectRatio -> 1,
                ScalingFunctions -> {"Reverse", Identity}]





                share|improve this answer









                $endgroup$



                For objects like circles that are readily converted to mathematical functions:



                r = 1;

                ContourPlot[
                x^2 + y^2 == r^2,
                {x, -1.05, 1.05}, {y, -1.05, 1.05},
                Frame -> False,
                Axes -> True,
                ScalingFunctions -> {"Reverse", Identity}]


                enter image description here



                Or



                Plot[
                {Sqrt[r^2 - x^2], -Sqrt[r^2 - x^2]},
                {x, -1.05, 1.05},
                PlotStyle -> ColorData[97][1],
                AspectRatio -> 1,
                ScalingFunctions -> {"Reverse", Identity}]






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 10 at 13:37









                Bob HanlonBob Hanlon

                61.4k33598




                61.4k33598






























                    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%2f191234%2fhow-to-reverse-x-axis-in-graphics%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

                    Questions related to Moebius Transform of Characteristic Function of the Primes

                    List of scandals in India

                    Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?