Rotating Standard Graphs

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite
1












Is there are way to rotate standard graphs in tikz?



For example, the following produces a cyclic graph with 6 vertices



begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endtikzpicture


Is there a way I can rotate this graph by a given angle?







share|improve this question


























    up vote
    6
    down vote

    favorite
    1












    Is there are way to rotate standard graphs in tikz?



    For example, the following produces a cyclic graph with 6 vertices



    begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
    graph[clockwise, radius=2cm] subgraph C_n [n=6];
    endtikzpicture


    Is there a way I can rotate this graph by a given angle?







    share|improve this question
























      up vote
      6
      down vote

      favorite
      1









      up vote
      6
      down vote

      favorite
      1






      1





      Is there are way to rotate standard graphs in tikz?



      For example, the following produces a cyclic graph with 6 vertices



      begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
      graph[clockwise, radius=2cm] subgraph C_n [n=6];
      endtikzpicture


      Is there a way I can rotate this graph by a given angle?







      share|improve this question














      Is there are way to rotate standard graphs in tikz?



      For example, the following produces a cyclic graph with 6 vertices



      begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
      graph[clockwise, radius=2cm] subgraph C_n [n=6];
      endtikzpicture


      Is there a way I can rotate this graph by a given angle?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 16 at 23:34

























      asked Aug 16 at 1:01









      Neil

      313




      313




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          9
          down vote













          Using rotate and transform shape you can rotate the graph any angle you choose.



          enter image description here



          documentclass[tikz,margin=0.5cm]standalone
          usetikzlibrarygraphs
          usetikzlibrarygraphs.standard
          begindocument
          begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
          beginscope[rotate=15,transform shape]
          graph[clockwise, radius=2cm] subgraph C_n [n=6];
          endscope
          endtikzpicture
          enddocument





          share|improve this answer



























            up vote
            8
            down vote













            Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.



            RESULT:



            enter image description here



            MWE: animation using imagemagik converter



            % arara: pdflatex: synctex: yes, action: nonstopmode
            % arara: animate: density: 150, delay: 15, other: -background white -alpha remove
            % arara: showanimate
            documentclass[tikz,margin=0.5cm]standalone
            usetikzlibrarygraphs
            usepackagegraphicx
            usetikzlibrarygraphs.standard,calc
            begindocument
            foreach x in 0,1,...,29
            begintikzpicture[
            every node/.style=
            fill=blue!20,
            circle,
            very thick,
            inner sep=0pt,
            minimum size=12pt

            ]
            pgfmathparseint(12*x)
            edefAnglepgfmathresult
            %Set image limits to avoid flickering
            draw(-3,4) rectangle (9,-9);
            draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
            ++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
            ++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
            ++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
            %basic drawing test
            beginscope[rotate=0]
            %Graph generated objet
            graph[clockwise, radius=2cm] subgraph C_n [n=6];
            %Tikz basic code objet
            foreach n in 1,2,...,6
            node[fill=red!20](nn) at (60*n:1.5)n;

            draw[red,->](n1)
            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
            -- (n5) -- (n6) -- (n1);
            node[label=-90:tiny Angle] at (0:2.5cm) 0;
            %Graphicx Objet
            node at (0,0)includegraphics[width=1.5cm]example-image;
            node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
            endscope

            %test rotate
            beginscope[shift=(6,0),rotate=Angle]

            %Graph generated objet
            graph[clockwise, radius=2cm] subgraph C_n [n=6];
            %Tikz basic code objet
            foreach n in 1,2,...,6
            node[fill=red!20](nn) at (60*n:1.5)n;

            draw[red,->](n1)
            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
            -- (n5) -- (n6) -- (n1);
            node[label=-90:tiny Angle] at (0:2.5cm) Angle;
            %Graphicx Objet
            node at (0,0)includegraphics[width=1.5cm]example-image;
            node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
            endscope

            %test rotate nodes
            beginscope[shift=(0,-6),rotate=0]
            %Graph generated objet
            graph[clockwise, radius=2cm] subgraph C_n [n=6];
            %Tikz basic code objet
            foreach n in 1,2,...,6
            node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;

            draw[red,->](n1)
            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
            -- (n5) -- (n6) -- (n1);
            node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
            %Graphicx Objet
            node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
            node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
            endscope

            %test 4 transform shape
            beginscope[shift=(6,-6),rotate=Angle, transform shape]
            %Graph generated objet
            graph[clockwise, radius=2cm] subgraph C_n [n=6];
            %Tikz basic code objet
            foreach n in 1,2,...,6
            node[fill=red!20](nn) at (60*n:1.5)n;

            draw[red,->](n1)
            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
            -- (n5) -- (n6) -- (n1);
            node[label=-90:tiny Angle] at (0:2.5cm) Angle;
            %Graphicx Objet
            node at (0,0)includegraphics[width=1.5cm]example-image;
            node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
            endscope

            endtikzpicture

            enddocument





            share|improve this answer



























              up vote
              3
              down vote













              You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.



              documentclass[11pt,border=2pt]standalone
              usepackagetkz-berge
              begindocument
              begintikzpicture
              GraphInit[vstyle=Shade]
              SetVertexNoLabel
              grCycle[x=0,y=0, rotation=90]6
              grCycle[x=10,y=0]6
              endtikzpicture
              enddocument


              The output running in Gummi is:
              enter image description here
              Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.



              EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.






              share|improve this answer






















                Your Answer







                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "85"
                ;
                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%2ftex.stackexchange.com%2fquestions%2f446225%2frotating-standard-graphs%23new-answer', 'question_page');

                );

                Post as a guest






























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                9
                down vote













                Using rotate and transform shape you can rotate the graph any angle you choose.



                enter image description here



                documentclass[tikz,margin=0.5cm]standalone
                usetikzlibrarygraphs
                usetikzlibrarygraphs.standard
                begindocument
                begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
                beginscope[rotate=15,transform shape]
                graph[clockwise, radius=2cm] subgraph C_n [n=6];
                endscope
                endtikzpicture
                enddocument





                share|improve this answer
























                  up vote
                  9
                  down vote













                  Using rotate and transform shape you can rotate the graph any angle you choose.



                  enter image description here



                  documentclass[tikz,margin=0.5cm]standalone
                  usetikzlibrarygraphs
                  usetikzlibrarygraphs.standard
                  begindocument
                  begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
                  beginscope[rotate=15,transform shape]
                  graph[clockwise, radius=2cm] subgraph C_n [n=6];
                  endscope
                  endtikzpicture
                  enddocument





                  share|improve this answer






















                    up vote
                    9
                    down vote










                    up vote
                    9
                    down vote









                    Using rotate and transform shape you can rotate the graph any angle you choose.



                    enter image description here



                    documentclass[tikz,margin=0.5cm]standalone
                    usetikzlibrarygraphs
                    usetikzlibrarygraphs.standard
                    begindocument
                    begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
                    beginscope[rotate=15,transform shape]
                    graph[clockwise, radius=2cm] subgraph C_n [n=6];
                    endscope
                    endtikzpicture
                    enddocument





                    share|improve this answer












                    Using rotate and transform shape you can rotate the graph any angle you choose.



                    enter image description here



                    documentclass[tikz,margin=0.5cm]standalone
                    usetikzlibrarygraphs
                    usetikzlibrarygraphs.standard
                    begindocument
                    begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
                    beginscope[rotate=15,transform shape]
                    graph[clockwise, radius=2cm] subgraph C_n [n=6];
                    endscope
                    endtikzpicture
                    enddocument






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Aug 16 at 1:21









                    Milo

                    4,71821243




                    4,71821243




















                        up vote
                        8
                        down vote













                        Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.



                        RESULT:



                        enter image description here



                        MWE: animation using imagemagik converter



                        % arara: pdflatex: synctex: yes, action: nonstopmode
                        % arara: animate: density: 150, delay: 15, other: -background white -alpha remove
                        % arara: showanimate
                        documentclass[tikz,margin=0.5cm]standalone
                        usetikzlibrarygraphs
                        usepackagegraphicx
                        usetikzlibrarygraphs.standard,calc
                        begindocument
                        foreach x in 0,1,...,29
                        begintikzpicture[
                        every node/.style=
                        fill=blue!20,
                        circle,
                        very thick,
                        inner sep=0pt,
                        minimum size=12pt

                        ]
                        pgfmathparseint(12*x)
                        edefAnglepgfmathresult
                        %Set image limits to avoid flickering
                        draw(-3,4) rectangle (9,-9);
                        draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
                        ++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
                        ++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
                        ++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
                        %basic drawing test
                        beginscope[rotate=0]
                        %Graph generated objet
                        graph[clockwise, radius=2cm] subgraph C_n [n=6];
                        %Tikz basic code objet
                        foreach n in 1,2,...,6
                        node[fill=red!20](nn) at (60*n:1.5)n;

                        draw[red,->](n1)
                        -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                        -- (n5) -- (n6) -- (n1);
                        node[label=-90:tiny Angle] at (0:2.5cm) 0;
                        %Graphicx Objet
                        node at (0,0)includegraphics[width=1.5cm]example-image;
                        node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                        endscope

                        %test rotate
                        beginscope[shift=(6,0),rotate=Angle]

                        %Graph generated objet
                        graph[clockwise, radius=2cm] subgraph C_n [n=6];
                        %Tikz basic code objet
                        foreach n in 1,2,...,6
                        node[fill=red!20](nn) at (60*n:1.5)n;

                        draw[red,->](n1)
                        -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                        -- (n5) -- (n6) -- (n1);
                        node[label=-90:tiny Angle] at (0:2.5cm) Angle;
                        %Graphicx Objet
                        node at (0,0)includegraphics[width=1.5cm]example-image;
                        node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                        endscope

                        %test rotate nodes
                        beginscope[shift=(0,-6),rotate=0]
                        %Graph generated objet
                        graph[clockwise, radius=2cm] subgraph C_n [n=6];
                        %Tikz basic code objet
                        foreach n in 1,2,...,6
                        node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;

                        draw[red,->](n1)
                        -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
                        -- (n5) -- (n6) -- (n1);
                        node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
                        %Graphicx Objet
                        node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
                        node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
                        endscope

                        %test 4 transform shape
                        beginscope[shift=(6,-6),rotate=Angle, transform shape]
                        %Graph generated objet
                        graph[clockwise, radius=2cm] subgraph C_n [n=6];
                        %Tikz basic code objet
                        foreach n in 1,2,...,6
                        node[fill=red!20](nn) at (60*n:1.5)n;

                        draw[red,->](n1)
                        -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                        -- (n5) -- (n6) -- (n1);
                        node[label=-90:tiny Angle] at (0:2.5cm) Angle;
                        %Graphicx Objet
                        node at (0,0)includegraphics[width=1.5cm]example-image;
                        node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                        endscope

                        endtikzpicture

                        enddocument





                        share|improve this answer
























                          up vote
                          8
                          down vote













                          Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.



                          RESULT:



                          enter image description here



                          MWE: animation using imagemagik converter



                          % arara: pdflatex: synctex: yes, action: nonstopmode
                          % arara: animate: density: 150, delay: 15, other: -background white -alpha remove
                          % arara: showanimate
                          documentclass[tikz,margin=0.5cm]standalone
                          usetikzlibrarygraphs
                          usepackagegraphicx
                          usetikzlibrarygraphs.standard,calc
                          begindocument
                          foreach x in 0,1,...,29
                          begintikzpicture[
                          every node/.style=
                          fill=blue!20,
                          circle,
                          very thick,
                          inner sep=0pt,
                          minimum size=12pt

                          ]
                          pgfmathparseint(12*x)
                          edefAnglepgfmathresult
                          %Set image limits to avoid flickering
                          draw(-3,4) rectangle (9,-9);
                          draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
                          ++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
                          ++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
                          ++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
                          %basic drawing test
                          beginscope[rotate=0]
                          %Graph generated objet
                          graph[clockwise, radius=2cm] subgraph C_n [n=6];
                          %Tikz basic code objet
                          foreach n in 1,2,...,6
                          node[fill=red!20](nn) at (60*n:1.5)n;

                          draw[red,->](n1)
                          -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                          -- (n5) -- (n6) -- (n1);
                          node[label=-90:tiny Angle] at (0:2.5cm) 0;
                          %Graphicx Objet
                          node at (0,0)includegraphics[width=1.5cm]example-image;
                          node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                          endscope

                          %test rotate
                          beginscope[shift=(6,0),rotate=Angle]

                          %Graph generated objet
                          graph[clockwise, radius=2cm] subgraph C_n [n=6];
                          %Tikz basic code objet
                          foreach n in 1,2,...,6
                          node[fill=red!20](nn) at (60*n:1.5)n;

                          draw[red,->](n1)
                          -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                          -- (n5) -- (n6) -- (n1);
                          node[label=-90:tiny Angle] at (0:2.5cm) Angle;
                          %Graphicx Objet
                          node at (0,0)includegraphics[width=1.5cm]example-image;
                          node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                          endscope

                          %test rotate nodes
                          beginscope[shift=(0,-6),rotate=0]
                          %Graph generated objet
                          graph[clockwise, radius=2cm] subgraph C_n [n=6];
                          %Tikz basic code objet
                          foreach n in 1,2,...,6
                          node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;

                          draw[red,->](n1)
                          -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
                          -- (n5) -- (n6) -- (n1);
                          node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
                          %Graphicx Objet
                          node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
                          node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
                          endscope

                          %test 4 transform shape
                          beginscope[shift=(6,-6),rotate=Angle, transform shape]
                          %Graph generated objet
                          graph[clockwise, radius=2cm] subgraph C_n [n=6];
                          %Tikz basic code objet
                          foreach n in 1,2,...,6
                          node[fill=red!20](nn) at (60*n:1.5)n;

                          draw[red,->](n1)
                          -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                          -- (n5) -- (n6) -- (n1);
                          node[label=-90:tiny Angle] at (0:2.5cm) Angle;
                          %Graphicx Objet
                          node at (0,0)includegraphics[width=1.5cm]example-image;
                          node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                          endscope

                          endtikzpicture

                          enddocument





                          share|improve this answer






















                            up vote
                            8
                            down vote










                            up vote
                            8
                            down vote









                            Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.



                            RESULT:



                            enter image description here



                            MWE: animation using imagemagik converter



                            % arara: pdflatex: synctex: yes, action: nonstopmode
                            % arara: animate: density: 150, delay: 15, other: -background white -alpha remove
                            % arara: showanimate
                            documentclass[tikz,margin=0.5cm]standalone
                            usetikzlibrarygraphs
                            usepackagegraphicx
                            usetikzlibrarygraphs.standard,calc
                            begindocument
                            foreach x in 0,1,...,29
                            begintikzpicture[
                            every node/.style=
                            fill=blue!20,
                            circle,
                            very thick,
                            inner sep=0pt,
                            minimum size=12pt

                            ]
                            pgfmathparseint(12*x)
                            edefAnglepgfmathresult
                            %Set image limits to avoid flickering
                            draw(-3,4) rectangle (9,-9);
                            draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
                            ++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
                            ++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
                            ++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
                            %basic drawing test
                            beginscope[rotate=0]
                            %Graph generated objet
                            graph[clockwise, radius=2cm] subgraph C_n [n=6];
                            %Tikz basic code objet
                            foreach n in 1,2,...,6
                            node[fill=red!20](nn) at (60*n:1.5)n;

                            draw[red,->](n1)
                            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                            -- (n5) -- (n6) -- (n1);
                            node[label=-90:tiny Angle] at (0:2.5cm) 0;
                            %Graphicx Objet
                            node at (0,0)includegraphics[width=1.5cm]example-image;
                            node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                            endscope

                            %test rotate
                            beginscope[shift=(6,0),rotate=Angle]

                            %Graph generated objet
                            graph[clockwise, radius=2cm] subgraph C_n [n=6];
                            %Tikz basic code objet
                            foreach n in 1,2,...,6
                            node[fill=red!20](nn) at (60*n:1.5)n;

                            draw[red,->](n1)
                            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                            -- (n5) -- (n6) -- (n1);
                            node[label=-90:tiny Angle] at (0:2.5cm) Angle;
                            %Graphicx Objet
                            node at (0,0)includegraphics[width=1.5cm]example-image;
                            node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                            endscope

                            %test rotate nodes
                            beginscope[shift=(0,-6),rotate=0]
                            %Graph generated objet
                            graph[clockwise, radius=2cm] subgraph C_n [n=6];
                            %Tikz basic code objet
                            foreach n in 1,2,...,6
                            node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;

                            draw[red,->](n1)
                            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
                            -- (n5) -- (n6) -- (n1);
                            node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
                            %Graphicx Objet
                            node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
                            node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
                            endscope

                            %test 4 transform shape
                            beginscope[shift=(6,-6),rotate=Angle, transform shape]
                            %Graph generated objet
                            graph[clockwise, radius=2cm] subgraph C_n [n=6];
                            %Tikz basic code objet
                            foreach n in 1,2,...,6
                            node[fill=red!20](nn) at (60*n:1.5)n;

                            draw[red,->](n1)
                            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                            -- (n5) -- (n6) -- (n1);
                            node[label=-90:tiny Angle] at (0:2.5cm) Angle;
                            %Graphicx Objet
                            node at (0,0)includegraphics[width=1.5cm]example-image;
                            node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                            endscope

                            endtikzpicture

                            enddocument





                            share|improve this answer












                            Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.



                            RESULT:



                            enter image description here



                            MWE: animation using imagemagik converter



                            % arara: pdflatex: synctex: yes, action: nonstopmode
                            % arara: animate: density: 150, delay: 15, other: -background white -alpha remove
                            % arara: showanimate
                            documentclass[tikz,margin=0.5cm]standalone
                            usetikzlibrarygraphs
                            usepackagegraphicx
                            usetikzlibrarygraphs.standard,calc
                            begindocument
                            foreach x in 0,1,...,29
                            begintikzpicture[
                            every node/.style=
                            fill=blue!20,
                            circle,
                            very thick,
                            inner sep=0pt,
                            minimum size=12pt

                            ]
                            pgfmathparseint(12*x)
                            edefAnglepgfmathresult
                            %Set image limits to avoid flickering
                            draw(-3,4) rectangle (9,-9);
                            draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
                            ++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
                            ++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
                            ++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
                            %basic drawing test
                            beginscope[rotate=0]
                            %Graph generated objet
                            graph[clockwise, radius=2cm] subgraph C_n [n=6];
                            %Tikz basic code objet
                            foreach n in 1,2,...,6
                            node[fill=red!20](nn) at (60*n:1.5)n;

                            draw[red,->](n1)
                            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                            -- (n5) -- (n6) -- (n1);
                            node[label=-90:tiny Angle] at (0:2.5cm) 0;
                            %Graphicx Objet
                            node at (0,0)includegraphics[width=1.5cm]example-image;
                            node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                            endscope

                            %test rotate
                            beginscope[shift=(6,0),rotate=Angle]

                            %Graph generated objet
                            graph[clockwise, radius=2cm] subgraph C_n [n=6];
                            %Tikz basic code objet
                            foreach n in 1,2,...,6
                            node[fill=red!20](nn) at (60*n:1.5)n;

                            draw[red,->](n1)
                            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                            -- (n5) -- (n6) -- (n1);
                            node[label=-90:tiny Angle] at (0:2.5cm) Angle;
                            %Graphicx Objet
                            node at (0,0)includegraphics[width=1.5cm]example-image;
                            node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                            endscope

                            %test rotate nodes
                            beginscope[shift=(0,-6),rotate=0]
                            %Graph generated objet
                            graph[clockwise, radius=2cm] subgraph C_n [n=6];
                            %Tikz basic code objet
                            foreach n in 1,2,...,6
                            node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;

                            draw[red,->](n1)
                            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
                            -- (n5) -- (n6) -- (n1);
                            node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
                            %Graphicx Objet
                            node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
                            node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
                            endscope

                            %test 4 transform shape
                            beginscope[shift=(6,-6),rotate=Angle, transform shape]
                            %Graph generated objet
                            graph[clockwise, radius=2cm] subgraph C_n [n=6];
                            %Tikz basic code objet
                            foreach n in 1,2,...,6
                            node[fill=red!20](nn) at (60*n:1.5)n;

                            draw[red,->](n1)
                            -- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
                            -- (n5) -- (n6) -- (n1);
                            node[label=-90:tiny Angle] at (0:2.5cm) Angle;
                            %Graphicx Objet
                            node at (0,0)includegraphics[width=1.5cm]example-image;
                            node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
                            endscope

                            endtikzpicture

                            enddocument






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Aug 16 at 8:34









                            J Leon V.

                            5,492425




                            5,492425




















                                up vote
                                3
                                down vote













                                You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.



                                documentclass[11pt,border=2pt]standalone
                                usepackagetkz-berge
                                begindocument
                                begintikzpicture
                                GraphInit[vstyle=Shade]
                                SetVertexNoLabel
                                grCycle[x=0,y=0, rotation=90]6
                                grCycle[x=10,y=0]6
                                endtikzpicture
                                enddocument


                                The output running in Gummi is:
                                enter image description here
                                Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.



                                EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.






                                share|improve this answer


























                                  up vote
                                  3
                                  down vote













                                  You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.



                                  documentclass[11pt,border=2pt]standalone
                                  usepackagetkz-berge
                                  begindocument
                                  begintikzpicture
                                  GraphInit[vstyle=Shade]
                                  SetVertexNoLabel
                                  grCycle[x=0,y=0, rotation=90]6
                                  grCycle[x=10,y=0]6
                                  endtikzpicture
                                  enddocument


                                  The output running in Gummi is:
                                  enter image description here
                                  Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.



                                  EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.






                                  share|improve this answer
























                                    up vote
                                    3
                                    down vote










                                    up vote
                                    3
                                    down vote









                                    You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.



                                    documentclass[11pt,border=2pt]standalone
                                    usepackagetkz-berge
                                    begindocument
                                    begintikzpicture
                                    GraphInit[vstyle=Shade]
                                    SetVertexNoLabel
                                    grCycle[x=0,y=0, rotation=90]6
                                    grCycle[x=10,y=0]6
                                    endtikzpicture
                                    enddocument


                                    The output running in Gummi is:
                                    enter image description here
                                    Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.



                                    EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.






                                    share|improve this answer














                                    You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.



                                    documentclass[11pt,border=2pt]standalone
                                    usepackagetkz-berge
                                    begindocument
                                    begintikzpicture
                                    GraphInit[vstyle=Shade]
                                    SetVertexNoLabel
                                    grCycle[x=0,y=0, rotation=90]6
                                    grCycle[x=10,y=0]6
                                    endtikzpicture
                                    enddocument


                                    The output running in Gummi is:
                                    enter image description here
                                    Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.



                                    EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.







                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited Aug 16 at 1:57

























                                    answered Aug 16 at 1:31









                                    DJP

                                    6,66921628




                                    6,66921628






















                                         

                                        draft saved


                                        draft discarded


























                                         


                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f446225%2frotating-standard-graphs%23new-answer', 'question_page');

                                        );

                                        Post as a guest













































































                                        這個網誌中的熱門文章

                                        tkz-euclide: tkzDrawCircle[R] not working

                                        How to combine Bézier curves to a surface?

                                        1st Magritte Awards