TikZ: Centering dash pattern between two nodesCan TikZ dashed lines emulate PSTricks dashed lines?TikZ: Centering dash pattern along the pathRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?Input/Output Nodes - Specification and Description LanguageTikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?Commutative diagram with curve connecting between nodesHow can I have TikZ automata accepting nodes be the same size as nonaccepting nodes?

Why didn't Boeing produce its own regional jet?

What does the same-ish mean?

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

files created then deleted at every second in tmp directory

How obscure is the use of 令 in 令和?

Is it a bad idea to plug the other end of ESD strap to wall ground?

Could the museum Saturn V's be refitted for one more flight?

Is this draw by repetition?

Send out email when Apex Queueable fails and test it

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

Notepad++ delete until colon for every line with replace all

How to show a landlord what we have in savings?

Do creatures with a speed 0ft., fly 30ft. (hover) ever touch the ground?

Why was Sir Cadogan fired?

Forgetting the musical notes while performing in concert

Car headlights in a world without electricity

What do you call someone who asks many questions?

Blending or harmonizing

Collected fruit by Seine's banks

Different meanings of こわい

What is the difference between 'contrib' and 'non-free' packages repositories?

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

Can I hook these wires up to find the connection to a dead outlet?

GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?



TikZ: Centering dash pattern between two nodes


Can TikZ dashed lines emulate PSTricks dashed lines?TikZ: Centering dash pattern along the pathRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?Input/Output Nodes - Specification and Description LanguageTikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?Commutative diagram with curve connecting between nodesHow can I have TikZ automata accepting nodes be the same size as nonaccepting nodes?













5















Is there a way to draw a dashed pattern between two nodes taking the middle point of these two nodes as the center point?



This is my code:



documentclassarticle
usepackage[utf8]inputenc
usepackageamsthm,amsmath,amssymb,authblk,tikz,graphicx
usetikzlibraryshapes,decorations,circuits.logic.US,circuits.logic.IEC,fit,external
tikzstyleloosely dashed=[dash pattern=on 4pt off 8pt]
tikzstyleloosely dashed2=[dash pattern=on 4pt off 8pt]

begindocument

beginfigure
centering
begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
path
(0,3) node(y) $Y$
(-1.5,0) node[draw, line width=1pt](x1) $X_1$
(1.5,0) node[draw, line width=1pt](x2) $X_2$;
draw [line width=1pt,-,black] (y) -- (x1);
draw [line width=1pt,-,black] (y) -- (x2);
draw [line width=3pt,-,loosely dashed,black] (x1) to[bend right=40] (x2);
endtikzpicture
endfigure

enddocument


And the resulting figure:



This is the resulting figure



It can clearly be seen that the dash from the X1 node is longer than that from the X2 node.



I want the right part of the dashed line to be the mirror image of the left part. Is there a way to do this (preferably regardless of the distance between the nodes, and the thickness or specific pattern of the line)?










share|improve this question









New contributor




Joost Kruis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Welcome to TexSE! Did you look at this question? tex.stackexchange.com/q/438299/15036

    – Thruston
    8 hours ago











  • Try draw [line width=3pt,-,loosely dashed,black] (x1.east) to[bend right=40] (x2.west);

    – CarLaTeX
    8 hours ago











  • @Thruston, thanks! That was indeed on of the pages I read before submitting this question, unfortunately I was not able to understand in. @CarLaTeX, thanks! This works! (I used draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);)

    – Joost Kruis
    8 hours ago











  • @CarLaTeX Please add an answer.

    – JouleV
    8 hours ago











  • @JouleV I can't explain the reason, maybe it works only by chance. Maybe it's somehow a duplicate of tex.stackexchange.com/questions/133271/….

    – CarLaTeX
    7 hours ago















5















Is there a way to draw a dashed pattern between two nodes taking the middle point of these two nodes as the center point?



This is my code:



documentclassarticle
usepackage[utf8]inputenc
usepackageamsthm,amsmath,amssymb,authblk,tikz,graphicx
usetikzlibraryshapes,decorations,circuits.logic.US,circuits.logic.IEC,fit,external
tikzstyleloosely dashed=[dash pattern=on 4pt off 8pt]
tikzstyleloosely dashed2=[dash pattern=on 4pt off 8pt]

begindocument

beginfigure
centering
begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
path
(0,3) node(y) $Y$
(-1.5,0) node[draw, line width=1pt](x1) $X_1$
(1.5,0) node[draw, line width=1pt](x2) $X_2$;
draw [line width=1pt,-,black] (y) -- (x1);
draw [line width=1pt,-,black] (y) -- (x2);
draw [line width=3pt,-,loosely dashed,black] (x1) to[bend right=40] (x2);
endtikzpicture
endfigure

enddocument


And the resulting figure:



This is the resulting figure



It can clearly be seen that the dash from the X1 node is longer than that from the X2 node.



I want the right part of the dashed line to be the mirror image of the left part. Is there a way to do this (preferably regardless of the distance between the nodes, and the thickness or specific pattern of the line)?










share|improve this question









New contributor




Joost Kruis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Welcome to TexSE! Did you look at this question? tex.stackexchange.com/q/438299/15036

    – Thruston
    8 hours ago











  • Try draw [line width=3pt,-,loosely dashed,black] (x1.east) to[bend right=40] (x2.west);

    – CarLaTeX
    8 hours ago











  • @Thruston, thanks! That was indeed on of the pages I read before submitting this question, unfortunately I was not able to understand in. @CarLaTeX, thanks! This works! (I used draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);)

    – Joost Kruis
    8 hours ago











  • @CarLaTeX Please add an answer.

    – JouleV
    8 hours ago











  • @JouleV I can't explain the reason, maybe it works only by chance. Maybe it's somehow a duplicate of tex.stackexchange.com/questions/133271/….

    – CarLaTeX
    7 hours ago













5












5








5


0






Is there a way to draw a dashed pattern between two nodes taking the middle point of these two nodes as the center point?



This is my code:



documentclassarticle
usepackage[utf8]inputenc
usepackageamsthm,amsmath,amssymb,authblk,tikz,graphicx
usetikzlibraryshapes,decorations,circuits.logic.US,circuits.logic.IEC,fit,external
tikzstyleloosely dashed=[dash pattern=on 4pt off 8pt]
tikzstyleloosely dashed2=[dash pattern=on 4pt off 8pt]

begindocument

beginfigure
centering
begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
path
(0,3) node(y) $Y$
(-1.5,0) node[draw, line width=1pt](x1) $X_1$
(1.5,0) node[draw, line width=1pt](x2) $X_2$;
draw [line width=1pt,-,black] (y) -- (x1);
draw [line width=1pt,-,black] (y) -- (x2);
draw [line width=3pt,-,loosely dashed,black] (x1) to[bend right=40] (x2);
endtikzpicture
endfigure

enddocument


And the resulting figure:



This is the resulting figure



It can clearly be seen that the dash from the X1 node is longer than that from the X2 node.



I want the right part of the dashed line to be the mirror image of the left part. Is there a way to do this (preferably regardless of the distance between the nodes, and the thickness or specific pattern of the line)?










share|improve this question









New contributor




Joost Kruis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












Is there a way to draw a dashed pattern between two nodes taking the middle point of these two nodes as the center point?



This is my code:



documentclassarticle
usepackage[utf8]inputenc
usepackageamsthm,amsmath,amssymb,authblk,tikz,graphicx
usetikzlibraryshapes,decorations,circuits.logic.US,circuits.logic.IEC,fit,external
tikzstyleloosely dashed=[dash pattern=on 4pt off 8pt]
tikzstyleloosely dashed2=[dash pattern=on 4pt off 8pt]

begindocument

beginfigure
centering
begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
path
(0,3) node(y) $Y$
(-1.5,0) node[draw, line width=1pt](x1) $X_1$
(1.5,0) node[draw, line width=1pt](x2) $X_2$;
draw [line width=1pt,-,black] (y) -- (x1);
draw [line width=1pt,-,black] (y) -- (x2);
draw [line width=3pt,-,loosely dashed,black] (x1) to[bend right=40] (x2);
endtikzpicture
endfigure

enddocument


And the resulting figure:



This is the resulting figure



It can clearly be seen that the dash from the X1 node is longer than that from the X2 node.



I want the right part of the dashed line to be the mirror image of the left part. Is there a way to do this (preferably regardless of the distance between the nodes, and the thickness or specific pattern of the line)?







tikz-pgf






share|improve this question









New contributor




Joost Kruis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Joost Kruis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 4 hours ago









JouleV

9,91322558




9,91322558






New contributor




Joost Kruis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 8 hours ago









Joost KruisJoost Kruis

262




262




New contributor




Joost Kruis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Joost Kruis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Joost Kruis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Welcome to TexSE! Did you look at this question? tex.stackexchange.com/q/438299/15036

    – Thruston
    8 hours ago











  • Try draw [line width=3pt,-,loosely dashed,black] (x1.east) to[bend right=40] (x2.west);

    – CarLaTeX
    8 hours ago











  • @Thruston, thanks! That was indeed on of the pages I read before submitting this question, unfortunately I was not able to understand in. @CarLaTeX, thanks! This works! (I used draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);)

    – Joost Kruis
    8 hours ago











  • @CarLaTeX Please add an answer.

    – JouleV
    8 hours ago











  • @JouleV I can't explain the reason, maybe it works only by chance. Maybe it's somehow a duplicate of tex.stackexchange.com/questions/133271/….

    – CarLaTeX
    7 hours ago

















  • Welcome to TexSE! Did you look at this question? tex.stackexchange.com/q/438299/15036

    – Thruston
    8 hours ago











  • Try draw [line width=3pt,-,loosely dashed,black] (x1.east) to[bend right=40] (x2.west);

    – CarLaTeX
    8 hours ago











  • @Thruston, thanks! That was indeed on of the pages I read before submitting this question, unfortunately I was not able to understand in. @CarLaTeX, thanks! This works! (I used draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);)

    – Joost Kruis
    8 hours ago











  • @CarLaTeX Please add an answer.

    – JouleV
    8 hours ago











  • @JouleV I can't explain the reason, maybe it works only by chance. Maybe it's somehow a duplicate of tex.stackexchange.com/questions/133271/….

    – CarLaTeX
    7 hours ago
















Welcome to TexSE! Did you look at this question? tex.stackexchange.com/q/438299/15036

– Thruston
8 hours ago





Welcome to TexSE! Did you look at this question? tex.stackexchange.com/q/438299/15036

– Thruston
8 hours ago













Try draw [line width=3pt,-,loosely dashed,black] (x1.east) to[bend right=40] (x2.west);

– CarLaTeX
8 hours ago





Try draw [line width=3pt,-,loosely dashed,black] (x1.east) to[bend right=40] (x2.west);

– CarLaTeX
8 hours ago













@Thruston, thanks! That was indeed on of the pages I read before submitting this question, unfortunately I was not able to understand in. @CarLaTeX, thanks! This works! (I used draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);)

– Joost Kruis
8 hours ago





@Thruston, thanks! That was indeed on of the pages I read before submitting this question, unfortunately I was not able to understand in. @CarLaTeX, thanks! This works! (I used draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);)

– Joost Kruis
8 hours ago













@CarLaTeX Please add an answer.

– JouleV
8 hours ago





@CarLaTeX Please add an answer.

– JouleV
8 hours ago













@JouleV I can't explain the reason, maybe it works only by chance. Maybe it's somehow a duplicate of tex.stackexchange.com/questions/133271/….

– CarLaTeX
7 hours ago





@JouleV I can't explain the reason, maybe it works only by chance. Maybe it's somehow a duplicate of tex.stackexchange.com/questions/133271/….

– CarLaTeX
7 hours ago










2 Answers
2






active

oldest

votes


















5














There are standard answers, but all of them are very advanced and hard to understand. However, with markings one can "mirror" a half of the curve like this.



documentclass[tikz]standalone
usetikzlibraryshapes,decorations,circuits.logic.US,circuits.logic.IEC,fit,external
tikzstyleloosely dashed=[dash pattern=on 4pt off 8pt]
tikzstyleloosely dashed2=[dash pattern=on 4pt off 8pt]

begindocument
begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
path
(0,3) node(y) $Y$
(-1.5,0) node[draw, line width=1pt](x1) $X_1$
(1.5,0) node[draw, line width=1pt](x2) $X_2$;
draw [line width=1pt,-,black] (y) -- (x1);
draw [line width=1pt,-,black] (y) -- (x2);
%draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);
path [postaction=
decorate,
decoration=
markings,
mark=at position 0.5 with coordinate (mid);

] (x1) to[bend right=40] (x2);
draw[line width=3pt,-,loosely dashed] ([xshift=-4pt]mid) to[out=180,in=-40] (x1);
draw[line width=3pt,-,loosely dashed] ([xshift=4pt]mid) to[out=0,in=-140] (x2);
endtikzpicture
enddocument


enter image description here






share|improve this answer






























    2














    Another way is to measure the path and then stretch the dash length a bit in such a way that the path ends with a full on. Please also note that tikzstyle is deprecated.



    documentclassarticle
    usepackagetikz
    usetikzlibrarydecorations.markings
    tikzset
    full dash/.style args=on #1 off #2
    decoration=
    markings,
    mark=at position 0 with
    pgfmathsetmacromystretch((pgfdecoratedpathlength-#1)/(#1+#2))/int((pgfdecoratedpathlength-#1)/(#1+#2))
    pgfmathsetmacromyon#1*mystretch
    xdefmyonmyon
    pgfmathsetmacromyoff#2*mystretch
    xdefmyoffmyoff
    ,
    ,
    preaction=decorate,draw=none,
    postaction=draw,dash pattern=on myon pt off myoff pt
    ,

    begindocument

    beginfigure
    centering
    begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
    path
    (0,3) node(y) $Y$
    (-1.5,0) node[draw, line width=1pt](x1) $X_1$
    (1.5,0) node[draw, line width=1pt](x2) $X_2$;
    draw [line width=1pt,-,black] (y) -- (x1);
    draw [line width=1pt,-,black] (y) -- (x2);
    draw [line width=3pt,-,full dash=on 3pt off 6pt,black] (x1) to[bend right=40] (x2);
    endtikzpicture
    endfigure

    enddocument


    enter image description here






    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',
      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
      );



      );






      Joost Kruis is a new contributor. Be nice, and check out our Code of Conduct.









      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482750%2ftikz-centering-dash-pattern-between-two-nodes%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









      5














      There are standard answers, but all of them are very advanced and hard to understand. However, with markings one can "mirror" a half of the curve like this.



      documentclass[tikz]standalone
      usetikzlibraryshapes,decorations,circuits.logic.US,circuits.logic.IEC,fit,external
      tikzstyleloosely dashed=[dash pattern=on 4pt off 8pt]
      tikzstyleloosely dashed2=[dash pattern=on 4pt off 8pt]

      begindocument
      begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
      path
      (0,3) node(y) $Y$
      (-1.5,0) node[draw, line width=1pt](x1) $X_1$
      (1.5,0) node[draw, line width=1pt](x2) $X_2$;
      draw [line width=1pt,-,black] (y) -- (x1);
      draw [line width=1pt,-,black] (y) -- (x2);
      %draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);
      path [postaction=
      decorate,
      decoration=
      markings,
      mark=at position 0.5 with coordinate (mid);

      ] (x1) to[bend right=40] (x2);
      draw[line width=3pt,-,loosely dashed] ([xshift=-4pt]mid) to[out=180,in=-40] (x1);
      draw[line width=3pt,-,loosely dashed] ([xshift=4pt]mid) to[out=0,in=-140] (x2);
      endtikzpicture
      enddocument


      enter image description here






      share|improve this answer



























        5














        There are standard answers, but all of them are very advanced and hard to understand. However, with markings one can "mirror" a half of the curve like this.



        documentclass[tikz]standalone
        usetikzlibraryshapes,decorations,circuits.logic.US,circuits.logic.IEC,fit,external
        tikzstyleloosely dashed=[dash pattern=on 4pt off 8pt]
        tikzstyleloosely dashed2=[dash pattern=on 4pt off 8pt]

        begindocument
        begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
        path
        (0,3) node(y) $Y$
        (-1.5,0) node[draw, line width=1pt](x1) $X_1$
        (1.5,0) node[draw, line width=1pt](x2) $X_2$;
        draw [line width=1pt,-,black] (y) -- (x1);
        draw [line width=1pt,-,black] (y) -- (x2);
        %draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);
        path [postaction=
        decorate,
        decoration=
        markings,
        mark=at position 0.5 with coordinate (mid);

        ] (x1) to[bend right=40] (x2);
        draw[line width=3pt,-,loosely dashed] ([xshift=-4pt]mid) to[out=180,in=-40] (x1);
        draw[line width=3pt,-,loosely dashed] ([xshift=4pt]mid) to[out=0,in=-140] (x2);
        endtikzpicture
        enddocument


        enter image description here






        share|improve this answer

























          5












          5








          5







          There are standard answers, but all of them are very advanced and hard to understand. However, with markings one can "mirror" a half of the curve like this.



          documentclass[tikz]standalone
          usetikzlibraryshapes,decorations,circuits.logic.US,circuits.logic.IEC,fit,external
          tikzstyleloosely dashed=[dash pattern=on 4pt off 8pt]
          tikzstyleloosely dashed2=[dash pattern=on 4pt off 8pt]

          begindocument
          begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
          path
          (0,3) node(y) $Y$
          (-1.5,0) node[draw, line width=1pt](x1) $X_1$
          (1.5,0) node[draw, line width=1pt](x2) $X_2$;
          draw [line width=1pt,-,black] (y) -- (x1);
          draw [line width=1pt,-,black] (y) -- (x2);
          %draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);
          path [postaction=
          decorate,
          decoration=
          markings,
          mark=at position 0.5 with coordinate (mid);

          ] (x1) to[bend right=40] (x2);
          draw[line width=3pt,-,loosely dashed] ([xshift=-4pt]mid) to[out=180,in=-40] (x1);
          draw[line width=3pt,-,loosely dashed] ([xshift=4pt]mid) to[out=0,in=-140] (x2);
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer













          There are standard answers, but all of them are very advanced and hard to understand. However, with markings one can "mirror" a half of the curve like this.



          documentclass[tikz]standalone
          usetikzlibraryshapes,decorations,circuits.logic.US,circuits.logic.IEC,fit,external
          tikzstyleloosely dashed=[dash pattern=on 4pt off 8pt]
          tikzstyleloosely dashed2=[dash pattern=on 4pt off 8pt]

          begindocument
          begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
          path
          (0,3) node(y) $Y$
          (-1.5,0) node[draw, line width=1pt](x1) $X_1$
          (1.5,0) node[draw, line width=1pt](x2) $X_2$;
          draw [line width=1pt,-,black] (y) -- (x1);
          draw [line width=1pt,-,black] (y) -- (x2);
          %draw [line width=3pt,-,loosely dashed,black] (x1.south east) to[bend right=40] (x2.south west);
          path [postaction=
          decorate,
          decoration=
          markings,
          mark=at position 0.5 with coordinate (mid);

          ] (x1) to[bend right=40] (x2);
          draw[line width=3pt,-,loosely dashed] ([xshift=-4pt]mid) to[out=180,in=-40] (x1);
          draw[line width=3pt,-,loosely dashed] ([xshift=4pt]mid) to[out=0,in=-140] (x2);
          endtikzpicture
          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 6 hours ago









          JouleVJouleV

          9,91322558




          9,91322558





















              2














              Another way is to measure the path and then stretch the dash length a bit in such a way that the path ends with a full on. Please also note that tikzstyle is deprecated.



              documentclassarticle
              usepackagetikz
              usetikzlibrarydecorations.markings
              tikzset
              full dash/.style args=on #1 off #2
              decoration=
              markings,
              mark=at position 0 with
              pgfmathsetmacromystretch((pgfdecoratedpathlength-#1)/(#1+#2))/int((pgfdecoratedpathlength-#1)/(#1+#2))
              pgfmathsetmacromyon#1*mystretch
              xdefmyonmyon
              pgfmathsetmacromyoff#2*mystretch
              xdefmyoffmyoff
              ,
              ,
              preaction=decorate,draw=none,
              postaction=draw,dash pattern=on myon pt off myoff pt
              ,

              begindocument

              beginfigure
              centering
              begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
              path
              (0,3) node(y) $Y$
              (-1.5,0) node[draw, line width=1pt](x1) $X_1$
              (1.5,0) node[draw, line width=1pt](x2) $X_2$;
              draw [line width=1pt,-,black] (y) -- (x1);
              draw [line width=1pt,-,black] (y) -- (x2);
              draw [line width=3pt,-,full dash=on 3pt off 6pt,black] (x1) to[bend right=40] (x2);
              endtikzpicture
              endfigure

              enddocument


              enter image description here






              share|improve this answer





























                2














                Another way is to measure the path and then stretch the dash length a bit in such a way that the path ends with a full on. Please also note that tikzstyle is deprecated.



                documentclassarticle
                usepackagetikz
                usetikzlibrarydecorations.markings
                tikzset
                full dash/.style args=on #1 off #2
                decoration=
                markings,
                mark=at position 0 with
                pgfmathsetmacromystretch((pgfdecoratedpathlength-#1)/(#1+#2))/int((pgfdecoratedpathlength-#1)/(#1+#2))
                pgfmathsetmacromyon#1*mystretch
                xdefmyonmyon
                pgfmathsetmacromyoff#2*mystretch
                xdefmyoffmyoff
                ,
                ,
                preaction=decorate,draw=none,
                postaction=draw,dash pattern=on myon pt off myoff pt
                ,

                begindocument

                beginfigure
                centering
                begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
                path
                (0,3) node(y) $Y$
                (-1.5,0) node[draw, line width=1pt](x1) $X_1$
                (1.5,0) node[draw, line width=1pt](x2) $X_2$;
                draw [line width=1pt,-,black] (y) -- (x1);
                draw [line width=1pt,-,black] (y) -- (x2);
                draw [line width=3pt,-,full dash=on 3pt off 6pt,black] (x1) to[bend right=40] (x2);
                endtikzpicture
                endfigure

                enddocument


                enter image description here






                share|improve this answer



























                  2












                  2








                  2







                  Another way is to measure the path and then stretch the dash length a bit in such a way that the path ends with a full on. Please also note that tikzstyle is deprecated.



                  documentclassarticle
                  usepackagetikz
                  usetikzlibrarydecorations.markings
                  tikzset
                  full dash/.style args=on #1 off #2
                  decoration=
                  markings,
                  mark=at position 0 with
                  pgfmathsetmacromystretch((pgfdecoratedpathlength-#1)/(#1+#2))/int((pgfdecoratedpathlength-#1)/(#1+#2))
                  pgfmathsetmacromyon#1*mystretch
                  xdefmyonmyon
                  pgfmathsetmacromyoff#2*mystretch
                  xdefmyoffmyoff
                  ,
                  ,
                  preaction=decorate,draw=none,
                  postaction=draw,dash pattern=on myon pt off myoff pt
                  ,

                  begindocument

                  beginfigure
                  centering
                  begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
                  path
                  (0,3) node(y) $Y$
                  (-1.5,0) node[draw, line width=1pt](x1) $X_1$
                  (1.5,0) node[draw, line width=1pt](x2) $X_2$;
                  draw [line width=1pt,-,black] (y) -- (x1);
                  draw [line width=1pt,-,black] (y) -- (x2);
                  draw [line width=3pt,-,full dash=on 3pt off 6pt,black] (x1) to[bend right=40] (x2);
                  endtikzpicture
                  endfigure

                  enddocument


                  enter image description here






                  share|improve this answer















                  Another way is to measure the path and then stretch the dash length a bit in such a way that the path ends with a full on. Please also note that tikzstyle is deprecated.



                  documentclassarticle
                  usepackagetikz
                  usetikzlibrarydecorations.markings
                  tikzset
                  full dash/.style args=on #1 off #2
                  decoration=
                  markings,
                  mark=at position 0 with
                  pgfmathsetmacromystretch((pgfdecoratedpathlength-#1)/(#1+#2))/int((pgfdecoratedpathlength-#1)/(#1+#2))
                  pgfmathsetmacromyon#1*mystretch
                  xdefmyonmyon
                  pgfmathsetmacromyoff#2*mystretch
                  xdefmyoffmyoff
                  ,
                  ,
                  preaction=decorate,draw=none,
                  postaction=draw,dash pattern=on myon pt off myoff pt
                  ,

                  begindocument

                  beginfigure
                  centering
                  begintikzpicture[every node/.style = draw=none, text=black, circle, minimum size = 13mm, fill=gray!25]
                  path
                  (0,3) node(y) $Y$
                  (-1.5,0) node[draw, line width=1pt](x1) $X_1$
                  (1.5,0) node[draw, line width=1pt](x2) $X_2$;
                  draw [line width=1pt,-,black] (y) -- (x1);
                  draw [line width=1pt,-,black] (y) -- (x2);
                  draw [line width=3pt,-,full dash=on 3pt off 6pt,black] (x1) to[bend right=40] (x2);
                  endtikzpicture
                  endfigure

                  enddocument


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 4 hours ago









                  JouleV

                  9,91322558




                  9,91322558










                  answered 4 hours ago









                  marmotmarmot

                  114k5145276




                  114k5145276




















                      Joost Kruis is a new contributor. Be nice, and check out our Code of Conduct.









                      draft saved

                      draft discarded


















                      Joost Kruis is a new contributor. Be nice, and check out our Code of Conduct.












                      Joost Kruis is a new contributor. Be nice, and check out our Code of Conduct.











                      Joost Kruis is a new contributor. Be nice, and check out our Code of Conduct.














                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482750%2ftikz-centering-dash-pattern-between-two-nodes%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

                      How does Billy Russo acquire his 'Jigsaw' mask? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why does Bane wear the mask?Why does Kylo Ren wear a mask?Why did Captain America remove his mask while fighting Batroc the Leaper?How did the OA acquire her wisdom?Is Billy Breckenridge gay?How does Adrian Toomes hide his earnings from the IRS?What is the state of affairs on Nootka Sound by the end of season 1?How did Tia Dalma acquire Captain Barbossa's body?How is one “Deemed Worthy”, to acquire the Greatsword “Dawn”?How did Karen acquire the handgun?

                      Личност Атрибути на личността | Литература и източници | НавигацияРаждането на личносттаредактиратередактирате

                      A sequel to Domino's tragic life Why Christmas is for Friends Cold comfort at Charles' padSad farewell for Lady JanePS Most watched News videos