Tikz have multiple arrows enter the same node but not on the exact same place












3















I have an issue where I have multiple arrows which enter the same node, but they end up covering each other. How do I make one arrow enter the node at a different spot?



I'd like the yellow arrows to come in at a different angle but still go behind the circles



documentclass[tikz]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, arrows.meta, decorations.shapes}

begin{document}

tikzset{decorate sep/.style 2 args={decorate,decoration={shape backgrounds,shape=circle,shape size=#1,shape sep=#2}}}

begin{tikzpicture}[
font=sf scriptsize,
>=LaTeX,
cell/.style={
rectangle,
sharp corners=5mm,
draw,
thick,
minimum width=1cm,
minimum height=1cm,
},
roundThing/.style={
circle,
draw,
inner sep=-0.5pt,
minimum height=1cm,
},
]

coordinate(upLeft) at (-2, 1);
node[roundThing](roundThing1){roundThing};

node[roundThing, below= of roundThing1](roundThing2){roundThing};

node[roundThing, below=of roundThing2](roundThing3){roundThing};

node[cell, right=of roundThing2](square1){square1};

node[cell] (square2) at (-1, -6) {square2};

draw[decorate sep={0.5mm}{3mm},fill] (roundThing2) -- (roundThing3);

draw[->, red] (square2) |- (roundThing1);
draw[->, red] (square2) |- (roundThing2);
draw[->, red] (square2) |- (roundThing3);

draw[->, blue] (roundThing1) -- (square1);
draw[->, blue] (roundThing2) -- (square1);
draw[->, blue] (roundThing3) -- (square1);


draw[yellow] (square1) |- (upLeft);
draw[->, yellow] (upLeft) |- (roundThing1);
draw[->, yellow] (upLeft) |- (roundThing2)[xshift=-1cm];
draw[->, yellow] (upLeft) |- (roundThing3);
end{tikzpicture}
end{document}


enter image description here










share|improve this question




















  • 1





    Please add a MWE showing what you have tried so far.

    – epR8GaYuh
    Dec 20 '18 at 11:37











  • to my answer i add short explanation.

    – Zarko
    Dec 20 '18 at 12:43
















3















I have an issue where I have multiple arrows which enter the same node, but they end up covering each other. How do I make one arrow enter the node at a different spot?



I'd like the yellow arrows to come in at a different angle but still go behind the circles



documentclass[tikz]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, arrows.meta, decorations.shapes}

begin{document}

tikzset{decorate sep/.style 2 args={decorate,decoration={shape backgrounds,shape=circle,shape size=#1,shape sep=#2}}}

begin{tikzpicture}[
font=sf scriptsize,
>=LaTeX,
cell/.style={
rectangle,
sharp corners=5mm,
draw,
thick,
minimum width=1cm,
minimum height=1cm,
},
roundThing/.style={
circle,
draw,
inner sep=-0.5pt,
minimum height=1cm,
},
]

coordinate(upLeft) at (-2, 1);
node[roundThing](roundThing1){roundThing};

node[roundThing, below= of roundThing1](roundThing2){roundThing};

node[roundThing, below=of roundThing2](roundThing3){roundThing};

node[cell, right=of roundThing2](square1){square1};

node[cell] (square2) at (-1, -6) {square2};

draw[decorate sep={0.5mm}{3mm},fill] (roundThing2) -- (roundThing3);

draw[->, red] (square2) |- (roundThing1);
draw[->, red] (square2) |- (roundThing2);
draw[->, red] (square2) |- (roundThing3);

draw[->, blue] (roundThing1) -- (square1);
draw[->, blue] (roundThing2) -- (square1);
draw[->, blue] (roundThing3) -- (square1);


draw[yellow] (square1) |- (upLeft);
draw[->, yellow] (upLeft) |- (roundThing1);
draw[->, yellow] (upLeft) |- (roundThing2)[xshift=-1cm];
draw[->, yellow] (upLeft) |- (roundThing3);
end{tikzpicture}
end{document}


enter image description here










share|improve this question




















  • 1





    Please add a MWE showing what you have tried so far.

    – epR8GaYuh
    Dec 20 '18 at 11:37











  • to my answer i add short explanation.

    – Zarko
    Dec 20 '18 at 12:43














3












3








3


0






I have an issue where I have multiple arrows which enter the same node, but they end up covering each other. How do I make one arrow enter the node at a different spot?



I'd like the yellow arrows to come in at a different angle but still go behind the circles



documentclass[tikz]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, arrows.meta, decorations.shapes}

begin{document}

tikzset{decorate sep/.style 2 args={decorate,decoration={shape backgrounds,shape=circle,shape size=#1,shape sep=#2}}}

begin{tikzpicture}[
font=sf scriptsize,
>=LaTeX,
cell/.style={
rectangle,
sharp corners=5mm,
draw,
thick,
minimum width=1cm,
minimum height=1cm,
},
roundThing/.style={
circle,
draw,
inner sep=-0.5pt,
minimum height=1cm,
},
]

coordinate(upLeft) at (-2, 1);
node[roundThing](roundThing1){roundThing};

node[roundThing, below= of roundThing1](roundThing2){roundThing};

node[roundThing, below=of roundThing2](roundThing3){roundThing};

node[cell, right=of roundThing2](square1){square1};

node[cell] (square2) at (-1, -6) {square2};

draw[decorate sep={0.5mm}{3mm},fill] (roundThing2) -- (roundThing3);

draw[->, red] (square2) |- (roundThing1);
draw[->, red] (square2) |- (roundThing2);
draw[->, red] (square2) |- (roundThing3);

draw[->, blue] (roundThing1) -- (square1);
draw[->, blue] (roundThing2) -- (square1);
draw[->, blue] (roundThing3) -- (square1);


draw[yellow] (square1) |- (upLeft);
draw[->, yellow] (upLeft) |- (roundThing1);
draw[->, yellow] (upLeft) |- (roundThing2)[xshift=-1cm];
draw[->, yellow] (upLeft) |- (roundThing3);
end{tikzpicture}
end{document}


enter image description here










share|improve this question
















I have an issue where I have multiple arrows which enter the same node, but they end up covering each other. How do I make one arrow enter the node at a different spot?



I'd like the yellow arrows to come in at a different angle but still go behind the circles



documentclass[tikz]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, arrows.meta, decorations.shapes}

begin{document}

tikzset{decorate sep/.style 2 args={decorate,decoration={shape backgrounds,shape=circle,shape size=#1,shape sep=#2}}}

begin{tikzpicture}[
font=sf scriptsize,
>=LaTeX,
cell/.style={
rectangle,
sharp corners=5mm,
draw,
thick,
minimum width=1cm,
minimum height=1cm,
},
roundThing/.style={
circle,
draw,
inner sep=-0.5pt,
minimum height=1cm,
},
]

coordinate(upLeft) at (-2, 1);
node[roundThing](roundThing1){roundThing};

node[roundThing, below= of roundThing1](roundThing2){roundThing};

node[roundThing, below=of roundThing2](roundThing3){roundThing};

node[cell, right=of roundThing2](square1){square1};

node[cell] (square2) at (-1, -6) {square2};

draw[decorate sep={0.5mm}{3mm},fill] (roundThing2) -- (roundThing3);

draw[->, red] (square2) |- (roundThing1);
draw[->, red] (square2) |- (roundThing2);
draw[->, red] (square2) |- (roundThing3);

draw[->, blue] (roundThing1) -- (square1);
draw[->, blue] (roundThing2) -- (square1);
draw[->, blue] (roundThing3) -- (square1);


draw[yellow] (square1) |- (upLeft);
draw[->, yellow] (upLeft) |- (roundThing1);
draw[->, yellow] (upLeft) |- (roundThing2)[xshift=-1cm];
draw[->, yellow] (upLeft) |- (roundThing3);
end{tikzpicture}
end{document}


enter image description here







tikz-pgf tikz-arrows






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 20 '18 at 11:56







Philippe

















asked Dec 20 '18 at 11:36









PhilippePhilippe

1524




1524








  • 1





    Please add a MWE showing what you have tried so far.

    – epR8GaYuh
    Dec 20 '18 at 11:37











  • to my answer i add short explanation.

    – Zarko
    Dec 20 '18 at 12:43














  • 1





    Please add a MWE showing what you have tried so far.

    – epR8GaYuh
    Dec 20 '18 at 11:37











  • to my answer i add short explanation.

    – Zarko
    Dec 20 '18 at 12:43








1




1





Please add a MWE showing what you have tried so far.

– epR8GaYuh
Dec 20 '18 at 11:37





Please add a MWE showing what you have tried so far.

– epR8GaYuh
Dec 20 '18 at 11:37













to my answer i add short explanation.

– Zarko
Dec 20 '18 at 12:43





to my answer i add short explanation.

– Zarko
Dec 20 '18 at 12:43










1 Answer
1






active

oldest

votes


















6














like this?



enter image description here



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta, positioning}

begin{document}
begin{tikzpicture}[
> = LaTeX,
node distance = 4mm and 8mm,
base/.style = {draw, minimum size=10mm, font=sffamilyscriptsize},
cell/.style = {base, thick},
roundThing/.style = {base,circle, inner sep=-0.5pt},
]
node[roundThing] (rt1) {roundThing};
node[roundThing, below=of rt1] (rt2) {roundThing};
node[roundThing, below=of rt2] (rt3) {roundThing};
%
draw[dotted, very thick, shorten >=0.5mm, shorten <=0.5mm] (rt2) -- (rt3);
%
node[cell, right=of rt2] (square1) {square1};
node[cell, below left=of rt3.south] (square2) {square2};
%
coordinate[above left=of rt1] (upLeft);
% yellow lines
draw[<-, yellow] (rt1.150) -- ++(150:4mm) -| (upLeft) -| (square1);
draw[<-, yellow] (rt2.150) -- ++(150:4mm) -| (upLeft);
draw[<-, yellow] (rt3.150) -- ++(150:4mm) -| (upLeft);
% blue lines
draw[->, blue] (rt1) edge (square1)
(rt2) edge (square1)
(rt3) to (square1);
% red lines
draw[->, red] (square2) |- (rt1);
draw[->, red] (square2) |- (rt2);
draw[->, red] (square2) |- (rt3);
end{tikzpicture}
end{document}



  • if you write to standalone document class option tikz, than it will load tikz package, so you not need to load it again

  • don't use commands like sf, bf etc, in modern LaTeX they are replaced with itshape, bfseries etc,

  • it is sensible to define common style features for all nodes, for example with name base and in it define, (in your case) draw, font, minimum size

  • for simple dotted lines you don't need decoration.shapes library ...






share|improve this answer


























  • What does .150 do in rt1.150?

    – Philippe
    Dec 20 '18 at 12:48











  • coordinate on the node border. it is on intersection on the node border and line with angle 150 degree through node center.

    – Zarko
    Dec 20 '18 at 12:55













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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466676%2ftikz-have-multiple-arrows-enter-the-same-node-but-not-on-the-exact-same-place%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









6














like this?



enter image description here



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta, positioning}

begin{document}
begin{tikzpicture}[
> = LaTeX,
node distance = 4mm and 8mm,
base/.style = {draw, minimum size=10mm, font=sffamilyscriptsize},
cell/.style = {base, thick},
roundThing/.style = {base,circle, inner sep=-0.5pt},
]
node[roundThing] (rt1) {roundThing};
node[roundThing, below=of rt1] (rt2) {roundThing};
node[roundThing, below=of rt2] (rt3) {roundThing};
%
draw[dotted, very thick, shorten >=0.5mm, shorten <=0.5mm] (rt2) -- (rt3);
%
node[cell, right=of rt2] (square1) {square1};
node[cell, below left=of rt3.south] (square2) {square2};
%
coordinate[above left=of rt1] (upLeft);
% yellow lines
draw[<-, yellow] (rt1.150) -- ++(150:4mm) -| (upLeft) -| (square1);
draw[<-, yellow] (rt2.150) -- ++(150:4mm) -| (upLeft);
draw[<-, yellow] (rt3.150) -- ++(150:4mm) -| (upLeft);
% blue lines
draw[->, blue] (rt1) edge (square1)
(rt2) edge (square1)
(rt3) to (square1);
% red lines
draw[->, red] (square2) |- (rt1);
draw[->, red] (square2) |- (rt2);
draw[->, red] (square2) |- (rt3);
end{tikzpicture}
end{document}



  • if you write to standalone document class option tikz, than it will load tikz package, so you not need to load it again

  • don't use commands like sf, bf etc, in modern LaTeX they are replaced with itshape, bfseries etc,

  • it is sensible to define common style features for all nodes, for example with name base and in it define, (in your case) draw, font, minimum size

  • for simple dotted lines you don't need decoration.shapes library ...






share|improve this answer


























  • What does .150 do in rt1.150?

    – Philippe
    Dec 20 '18 at 12:48











  • coordinate on the node border. it is on intersection on the node border and line with angle 150 degree through node center.

    – Zarko
    Dec 20 '18 at 12:55


















6














like this?



enter image description here



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta, positioning}

begin{document}
begin{tikzpicture}[
> = LaTeX,
node distance = 4mm and 8mm,
base/.style = {draw, minimum size=10mm, font=sffamilyscriptsize},
cell/.style = {base, thick},
roundThing/.style = {base,circle, inner sep=-0.5pt},
]
node[roundThing] (rt1) {roundThing};
node[roundThing, below=of rt1] (rt2) {roundThing};
node[roundThing, below=of rt2] (rt3) {roundThing};
%
draw[dotted, very thick, shorten >=0.5mm, shorten <=0.5mm] (rt2) -- (rt3);
%
node[cell, right=of rt2] (square1) {square1};
node[cell, below left=of rt3.south] (square2) {square2};
%
coordinate[above left=of rt1] (upLeft);
% yellow lines
draw[<-, yellow] (rt1.150) -- ++(150:4mm) -| (upLeft) -| (square1);
draw[<-, yellow] (rt2.150) -- ++(150:4mm) -| (upLeft);
draw[<-, yellow] (rt3.150) -- ++(150:4mm) -| (upLeft);
% blue lines
draw[->, blue] (rt1) edge (square1)
(rt2) edge (square1)
(rt3) to (square1);
% red lines
draw[->, red] (square2) |- (rt1);
draw[->, red] (square2) |- (rt2);
draw[->, red] (square2) |- (rt3);
end{tikzpicture}
end{document}



  • if you write to standalone document class option tikz, than it will load tikz package, so you not need to load it again

  • don't use commands like sf, bf etc, in modern LaTeX they are replaced with itshape, bfseries etc,

  • it is sensible to define common style features for all nodes, for example with name base and in it define, (in your case) draw, font, minimum size

  • for simple dotted lines you don't need decoration.shapes library ...






share|improve this answer


























  • What does .150 do in rt1.150?

    – Philippe
    Dec 20 '18 at 12:48











  • coordinate on the node border. it is on intersection on the node border and line with angle 150 degree through node center.

    – Zarko
    Dec 20 '18 at 12:55
















6












6








6







like this?



enter image description here



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta, positioning}

begin{document}
begin{tikzpicture}[
> = LaTeX,
node distance = 4mm and 8mm,
base/.style = {draw, minimum size=10mm, font=sffamilyscriptsize},
cell/.style = {base, thick},
roundThing/.style = {base,circle, inner sep=-0.5pt},
]
node[roundThing] (rt1) {roundThing};
node[roundThing, below=of rt1] (rt2) {roundThing};
node[roundThing, below=of rt2] (rt3) {roundThing};
%
draw[dotted, very thick, shorten >=0.5mm, shorten <=0.5mm] (rt2) -- (rt3);
%
node[cell, right=of rt2] (square1) {square1};
node[cell, below left=of rt3.south] (square2) {square2};
%
coordinate[above left=of rt1] (upLeft);
% yellow lines
draw[<-, yellow] (rt1.150) -- ++(150:4mm) -| (upLeft) -| (square1);
draw[<-, yellow] (rt2.150) -- ++(150:4mm) -| (upLeft);
draw[<-, yellow] (rt3.150) -- ++(150:4mm) -| (upLeft);
% blue lines
draw[->, blue] (rt1) edge (square1)
(rt2) edge (square1)
(rt3) to (square1);
% red lines
draw[->, red] (square2) |- (rt1);
draw[->, red] (square2) |- (rt2);
draw[->, red] (square2) |- (rt3);
end{tikzpicture}
end{document}



  • if you write to standalone document class option tikz, than it will load tikz package, so you not need to load it again

  • don't use commands like sf, bf etc, in modern LaTeX they are replaced with itshape, bfseries etc,

  • it is sensible to define common style features for all nodes, for example with name base and in it define, (in your case) draw, font, minimum size

  • for simple dotted lines you don't need decoration.shapes library ...






share|improve this answer















like this?



enter image description here



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta, positioning}

begin{document}
begin{tikzpicture}[
> = LaTeX,
node distance = 4mm and 8mm,
base/.style = {draw, minimum size=10mm, font=sffamilyscriptsize},
cell/.style = {base, thick},
roundThing/.style = {base,circle, inner sep=-0.5pt},
]
node[roundThing] (rt1) {roundThing};
node[roundThing, below=of rt1] (rt2) {roundThing};
node[roundThing, below=of rt2] (rt3) {roundThing};
%
draw[dotted, very thick, shorten >=0.5mm, shorten <=0.5mm] (rt2) -- (rt3);
%
node[cell, right=of rt2] (square1) {square1};
node[cell, below left=of rt3.south] (square2) {square2};
%
coordinate[above left=of rt1] (upLeft);
% yellow lines
draw[<-, yellow] (rt1.150) -- ++(150:4mm) -| (upLeft) -| (square1);
draw[<-, yellow] (rt2.150) -- ++(150:4mm) -| (upLeft);
draw[<-, yellow] (rt3.150) -- ++(150:4mm) -| (upLeft);
% blue lines
draw[->, blue] (rt1) edge (square1)
(rt2) edge (square1)
(rt3) to (square1);
% red lines
draw[->, red] (square2) |- (rt1);
draw[->, red] (square2) |- (rt2);
draw[->, red] (square2) |- (rt3);
end{tikzpicture}
end{document}



  • if you write to standalone document class option tikz, than it will load tikz package, so you not need to load it again

  • don't use commands like sf, bf etc, in modern LaTeX they are replaced with itshape, bfseries etc,

  • it is sensible to define common style features for all nodes, for example with name base and in it define, (in your case) draw, font, minimum size

  • for simple dotted lines you don't need decoration.shapes library ...







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 20 '18 at 13:53









Rmano

7,81221647




7,81221647










answered Dec 20 '18 at 12:31









ZarkoZarko

122k865160




122k865160













  • What does .150 do in rt1.150?

    – Philippe
    Dec 20 '18 at 12:48











  • coordinate on the node border. it is on intersection on the node border and line with angle 150 degree through node center.

    – Zarko
    Dec 20 '18 at 12:55





















  • What does .150 do in rt1.150?

    – Philippe
    Dec 20 '18 at 12:48











  • coordinate on the node border. it is on intersection on the node border and line with angle 150 degree through node center.

    – Zarko
    Dec 20 '18 at 12:55



















What does .150 do in rt1.150?

– Philippe
Dec 20 '18 at 12:48





What does .150 do in rt1.150?

– Philippe
Dec 20 '18 at 12:48













coordinate on the node border. it is on intersection on the node border and line with angle 150 degree through node center.

– Zarko
Dec 20 '18 at 12:55







coordinate on the node border. it is on intersection on the node border and line with angle 150 degree through node center.

– Zarko
Dec 20 '18 at 12:55




















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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466676%2ftikz-have-multiple-arrows-enter-the-same-node-but-not-on-the-exact-same-place%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

Plaza Victoria

Puebla de Zaragoza

Musa