How to edit the following dashed line?











up vote
2
down vote

favorite












I need to edit this code so the red dashed line can end up at R4 not R3 as in the following pictureenter image description here .



 documentclass[tikz,border=3.14mm]{standalone}
usetikzlibrary{positioning,calc,arrows.meta}
begin{document}
begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner
sep=0pt,
fill=cyan!50}]
node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
{};
node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
(R4){};
node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
{draw[thick,-latex,cyan!50] (RX) -- (RY);}


draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-
(R2)$),
n1={atan2(y1,x1)},n2={atan2(y2,x2)} in
([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
([yshift=1mm,xshift=-2mm]R3.north);

end{tikzpicture}
end{document}









share|improve this question


























    up vote
    2
    down vote

    favorite












    I need to edit this code so the red dashed line can end up at R4 not R3 as in the following pictureenter image description here .



     documentclass[tikz,border=3.14mm]{standalone}
    usetikzlibrary{positioning,calc,arrows.meta}
    begin{document}
    begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner
    sep=0pt,
    fill=cyan!50}]
    node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
    node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
    node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
    {};
    node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
    (R4){};
    node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
    foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
    {draw[thick,-latex,cyan!50] (RX) -- (RY);}


    draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-
    (R2)$),
    n1={atan2(y1,x1)},n2={atan2(y2,x2)} in
    ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
    ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
    ([yshift=1mm,xshift=-2mm]R3.north);

    end{tikzpicture}
    end{document}









    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I need to edit this code so the red dashed line can end up at R4 not R3 as in the following pictureenter image description here .



       documentclass[tikz,border=3.14mm]{standalone}
      usetikzlibrary{positioning,calc,arrows.meta}
      begin{document}
      begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner
      sep=0pt,
      fill=cyan!50}]
      node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
      node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
      node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
      {};
      node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
      (R4){};
      node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
      foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
      {draw[thick,-latex,cyan!50] (RX) -- (RY);}


      draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-
      (R2)$),
      n1={atan2(y1,x1)},n2={atan2(y2,x2)} in
      ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
      ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
      ([yshift=1mm,xshift=-2mm]R3.north);

      end{tikzpicture}
      end{document}









      share|improve this question













      I need to edit this code so the red dashed line can end up at R4 not R3 as in the following pictureenter image description here .



       documentclass[tikz,border=3.14mm]{standalone}
      usetikzlibrary{positioning,calc,arrows.meta}
      begin{document}
      begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner
      sep=0pt,
      fill=cyan!50}]
      node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
      node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
      node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
      {};
      node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
      (R4){};
      node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
      foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
      {draw[thick,-latex,cyan!50] (RX) -- (RY);}


      draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-
      (R2)$),
      n1={atan2(y1,x1)},n2={atan2(y2,x2)} in
      ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
      ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
      ([yshift=1mm,xshift=-2mm]R3.north);

      end{tikzpicture}
      end{document}






      tikz-pgf tikz-arrows






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      Mohamed

      824




      824






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          You need to add some code for the red line:



          draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
          n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
          ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
          ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
          ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
          ([yshift=1mm,xshift=-2mm]R4.north);


          With the complete MWE



          documentclass[tikz,border=3.14mm]{standalone}

          usetikzlibrary{positioning,calc,arrows.meta}


          begin{document}
          begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner sep=0pt,fill=cyan!50}]
          node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
          node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
          node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
          {};
          node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
          (R4){};
          node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
          foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
          {draw[thick,-latex,cyan!50] (RX) -- (RY);}


          %draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$),
          draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
          n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
          ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
          ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
          ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
          ([yshift=1mm,xshift=-2mm]R4.north);

          end{tikzpicture}
          end{document}


          you get:



          enter image description here






          share|improve this answer





















          • If you use ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] instead, there won't be a kink. (+1) draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R4)-(R3)$), n1={atan2(y1,x1)},n2={atan2(y2,x2)} in ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5] ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] ([yshift=1mm]R3.north) to[out=0,in=n2-180,looseness=0.5] ([yshift=1mm,xshift=-2mm]R4.north);
            – marmot
            2 hours ago












          • @marmot I see, thanks!
            – Kurt
            1 hour ago


















          up vote
          1
          down vote













          Instead of reconstructing the path of the red dotted arrow by clever calculations, you can use the preaction key which allows you to place the path in a temporary scope that you move vertically with transform canvas.



          To make it look prettier, I rounded the angles with the rounded key rounded corners=5pt.



          path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
          ,transform canvas={yshift=3mm}}
          ] (R1.center)to(R2.center)to(R3.center)to(R4.center);


          path



          The result without the rounded corners:



          path-no



          documentclass[tikz,border=3.14mm]{standalone}
          usetikzlibrary{positioning,calc,arrows.meta}
          begin{document}
          begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner
          sep=0pt,
          fill=cyan!50}]
          node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
          node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
          node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
          {};
          node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
          (R4){};
          node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
          foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
          {draw[thick,-latex,cyan!50] (RX) -- (RY);}

          path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
          ,transform canvas={yshift=3mm}}
          ] (R1.center)to(R2.center)to(R3.center)to(R4.center);
          end{tikzpicture}
          end{document}





          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: 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%2ftex.stackexchange.com%2fquestions%2f463263%2fhow-to-edit-the-following-dashed-line%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








            up vote
            2
            down vote













            You need to add some code for the red line:



            draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
            n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
            ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
            ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
            ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
            ([yshift=1mm,xshift=-2mm]R4.north);


            With the complete MWE



            documentclass[tikz,border=3.14mm]{standalone}

            usetikzlibrary{positioning,calc,arrows.meta}


            begin{document}
            begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner sep=0pt,fill=cyan!50}]
            node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
            node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
            node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
            {};
            node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
            (R4){};
            node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
            foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
            {draw[thick,-latex,cyan!50] (RX) -- (RY);}


            %draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$),
            draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
            n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
            ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
            ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
            ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
            ([yshift=1mm,xshift=-2mm]R4.north);

            end{tikzpicture}
            end{document}


            you get:



            enter image description here






            share|improve this answer





















            • If you use ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] instead, there won't be a kink. (+1) draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R4)-(R3)$), n1={atan2(y1,x1)},n2={atan2(y2,x2)} in ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5] ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] ([yshift=1mm]R3.north) to[out=0,in=n2-180,looseness=0.5] ([yshift=1mm,xshift=-2mm]R4.north);
              – marmot
              2 hours ago












            • @marmot I see, thanks!
              – Kurt
              1 hour ago















            up vote
            2
            down vote













            You need to add some code for the red line:



            draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
            n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
            ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
            ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
            ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
            ([yshift=1mm,xshift=-2mm]R4.north);


            With the complete MWE



            documentclass[tikz,border=3.14mm]{standalone}

            usetikzlibrary{positioning,calc,arrows.meta}


            begin{document}
            begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner sep=0pt,fill=cyan!50}]
            node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
            node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
            node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
            {};
            node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
            (R4){};
            node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
            foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
            {draw[thick,-latex,cyan!50] (RX) -- (RY);}


            %draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$),
            draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
            n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
            ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
            ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
            ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
            ([yshift=1mm,xshift=-2mm]R4.north);

            end{tikzpicture}
            end{document}


            you get:



            enter image description here






            share|improve this answer





















            • If you use ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] instead, there won't be a kink. (+1) draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R4)-(R3)$), n1={atan2(y1,x1)},n2={atan2(y2,x2)} in ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5] ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] ([yshift=1mm]R3.north) to[out=0,in=n2-180,looseness=0.5] ([yshift=1mm,xshift=-2mm]R4.north);
              – marmot
              2 hours ago












            • @marmot I see, thanks!
              – Kurt
              1 hour ago













            up vote
            2
            down vote










            up vote
            2
            down vote









            You need to add some code for the red line:



            draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
            n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
            ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
            ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
            ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
            ([yshift=1mm,xshift=-2mm]R4.north);


            With the complete MWE



            documentclass[tikz,border=3.14mm]{standalone}

            usetikzlibrary{positioning,calc,arrows.meta}


            begin{document}
            begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner sep=0pt,fill=cyan!50}]
            node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
            node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
            node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
            {};
            node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
            (R4){};
            node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
            foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
            {draw[thick,-latex,cyan!50] (RX) -- (RY);}


            %draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$),
            draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
            n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
            ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
            ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
            ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
            ([yshift=1mm,xshift=-2mm]R4.north);

            end{tikzpicture}
            end{document}


            you get:



            enter image description here






            share|improve this answer












            You need to add some code for the red line:



            draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
            n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
            ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
            ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
            ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
            ([yshift=1mm,xshift=-2mm]R4.north);


            With the complete MWE



            documentclass[tikz,border=3.14mm]{standalone}

            usetikzlibrary{positioning,calc,arrows.meta}


            begin{document}
            begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner sep=0pt,fill=cyan!50}]
            node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
            node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
            node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
            {};
            node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
            (R4){};
            node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
            foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
            {draw[thick,-latex,cyan!50] (RX) -- (RY);}


            %draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$),
            draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R3)-(R2)$), p3=($(R4)-(R3)$),
            n1={atan2(y1,x1)},n2={atan2(y2,x2)},n3={atan2(y3,x3)} in
            ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5]
            ([yshift=1mm]R2.north) to[out=0,in=n2-180,looseness=0.5]
            ([yshift=1mm]R3.north) to[out=0,in=n3-180,looseness=0.5]
            ([yshift=1mm,xshift=-2mm]R4.north);

            end{tikzpicture}
            end{document}


            you get:



            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 2 hours ago









            Kurt

            34.4k846157




            34.4k846157












            • If you use ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] instead, there won't be a kink. (+1) draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R4)-(R3)$), n1={atan2(y1,x1)},n2={atan2(y2,x2)} in ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5] ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] ([yshift=1mm]R3.north) to[out=0,in=n2-180,looseness=0.5] ([yshift=1mm,xshift=-2mm]R4.north);
              – marmot
              2 hours ago












            • @marmot I see, thanks!
              – Kurt
              1 hour ago


















            • If you use ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] instead, there won't be a kink. (+1) draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R4)-(R3)$), n1={atan2(y1,x1)},n2={atan2(y2,x2)} in ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5] ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] ([yshift=1mm]R3.north) to[out=0,in=n2-180,looseness=0.5] ([yshift=1mm,xshift=-2mm]R4.north);
              – marmot
              2 hours ago












            • @marmot I see, thanks!
              – Kurt
              1 hour ago
















            If you use ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] instead, there won't be a kink. (+1) draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R4)-(R3)$), n1={atan2(y1,x1)},n2={atan2(y2,x2)} in ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5] ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] ([yshift=1mm]R3.north) to[out=0,in=n2-180,looseness=0.5] ([yshift=1mm,xshift=-2mm]R4.north);
            – marmot
            2 hours ago






            If you use ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] instead, there won't be a kink. (+1) draw[thick,red,{Circle}-latex,dashed] let p1=($(R2)-(R1)$), p2=($(R4)-(R3)$), n1={atan2(y1,x1)},n2={atan2(y2,x2)} in ([yshift=1mm]R1.north) to[out=n1,in=180,looseness=0.5] ([yshift=1mm]R2.north) to[out=0,in=180,looseness=0.5] ([yshift=1mm]R3.north) to[out=0,in=n2-180,looseness=0.5] ([yshift=1mm,xshift=-2mm]R4.north);
            – marmot
            2 hours ago














            @marmot I see, thanks!
            – Kurt
            1 hour ago




            @marmot I see, thanks!
            – Kurt
            1 hour ago










            up vote
            1
            down vote













            Instead of reconstructing the path of the red dotted arrow by clever calculations, you can use the preaction key which allows you to place the path in a temporary scope that you move vertically with transform canvas.



            To make it look prettier, I rounded the angles with the rounded key rounded corners=5pt.



            path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
            ,transform canvas={yshift=3mm}}
            ] (R1.center)to(R2.center)to(R3.center)to(R4.center);


            path



            The result without the rounded corners:



            path-no



            documentclass[tikz,border=3.14mm]{standalone}
            usetikzlibrary{positioning,calc,arrows.meta}
            begin{document}
            begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner
            sep=0pt,
            fill=cyan!50}]
            node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
            node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
            node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
            {};
            node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
            (R4){};
            node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
            foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
            {draw[thick,-latex,cyan!50] (RX) -- (RY);}

            path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
            ,transform canvas={yshift=3mm}}
            ] (R1.center)to(R2.center)to(R3.center)to(R4.center);
            end{tikzpicture}
            end{document}





            share|improve this answer

























              up vote
              1
              down vote













              Instead of reconstructing the path of the red dotted arrow by clever calculations, you can use the preaction key which allows you to place the path in a temporary scope that you move vertically with transform canvas.



              To make it look prettier, I rounded the angles with the rounded key rounded corners=5pt.



              path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
              ,transform canvas={yshift=3mm}}
              ] (R1.center)to(R2.center)to(R3.center)to(R4.center);


              path



              The result without the rounded corners:



              path-no



              documentclass[tikz,border=3.14mm]{standalone}
              usetikzlibrary{positioning,calc,arrows.meta}
              begin{document}
              begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner
              sep=0pt,
              fill=cyan!50}]
              node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
              node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
              node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
              {};
              node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
              (R4){};
              node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
              foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
              {draw[thick,-latex,cyan!50] (RX) -- (RY);}

              path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
              ,transform canvas={yshift=3mm}}
              ] (R1.center)to(R2.center)to(R3.center)to(R4.center);
              end{tikzpicture}
              end{document}





              share|improve this answer























                up vote
                1
                down vote










                up vote
                1
                down vote









                Instead of reconstructing the path of the red dotted arrow by clever calculations, you can use the preaction key which allows you to place the path in a temporary scope that you move vertically with transform canvas.



                To make it look prettier, I rounded the angles with the rounded key rounded corners=5pt.



                path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
                ,transform canvas={yshift=3mm}}
                ] (R1.center)to(R2.center)to(R3.center)to(R4.center);


                path



                The result without the rounded corners:



                path-no



                documentclass[tikz,border=3.14mm]{standalone}
                usetikzlibrary{positioning,calc,arrows.meta}
                begin{document}
                begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner
                sep=0pt,
                fill=cyan!50}]
                node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
                node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
                node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
                {};
                node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
                (R4){};
                node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
                foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
                {draw[thick,-latex,cyan!50] (RX) -- (RY);}

                path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
                ,transform canvas={yshift=3mm}}
                ] (R1.center)to(R2.center)to(R3.center)to(R4.center);
                end{tikzpicture}
                end{document}





                share|improve this answer












                Instead of reconstructing the path of the red dotted arrow by clever calculations, you can use the preaction key which allows you to place the path in a temporary scope that you move vertically with transform canvas.



                To make it look prettier, I rounded the angles with the rounded key rounded corners=5pt.



                path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
                ,transform canvas={yshift=3mm}}
                ] (R1.center)to(R2.center)to(R3.center)to(R4.center);


                path



                The result without the rounded corners:



                path-no



                documentclass[tikz,border=3.14mm]{standalone}
                usetikzlibrary{positioning,calc,arrows.meta}
                begin{document}
                begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner
                sep=0pt,
                fill=cyan!50}]
                node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
                node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
                node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3)
                {};
                node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}]
                (R4){};
                node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
                foreach X [evaluate=X as Y using {int(X+1)}] in {1,...,4}
                {draw[thick,-latex,cyan!50] (RX) -- (RY);}

                path[rounded corners=5pt,preaction={draw,red,thick,{Circle}-latex,
                ,transform canvas={yshift=3mm}}
                ] (R1.center)to(R2.center)to(R3.center)to(R4.center);
                end{tikzpicture}
                end{document}






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 11 mins ago









                AndréC

                6,67711140




                6,67711140






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to TeX - LaTeX 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.


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





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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.


                    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%2ftex.stackexchange.com%2fquestions%2f463263%2fhow-to-edit-the-following-dashed-line%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

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    Refactoring coordinates for Minecraft Pi buildings written in Python