How to correctly align arrow tip
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I have got this code:
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(0pt,-20pt) |- ++(-170pt,-20pt) |- (a.south);
endtikzpicture
Which produces this graph:
I would like to align the arrow tip direction at the center of A. Can you help me please?
tikz-pgf tikz-arrows
add a comment |Â
up vote
3
down vote
favorite
I have got this code:
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(0pt,-20pt) |- ++(-170pt,-20pt) |- (a.south);
endtikzpicture
Which produces this graph:
I would like to align the arrow tip direction at the center of A. Can you help me please?
tikz-pgf tikz-arrows
Change the second last line topath [draw, ->, ultra thick, dashed] (c.south) |- ([yshift=-20pt]a.south) -- (a.south);
. The reason why the arrow tip is turned is thata.south
is a tiny bit to the left of the coordinate that you are shifting to with++(0pt,-20pt) |- ++(-170pt,-20pt)
.
â Jasper Habicht
Sep 10 at 20:34
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I have got this code:
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(0pt,-20pt) |- ++(-170pt,-20pt) |- (a.south);
endtikzpicture
Which produces this graph:
I would like to align the arrow tip direction at the center of A. Can you help me please?
tikz-pgf tikz-arrows
I have got this code:
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(0pt,-20pt) |- ++(-170pt,-20pt) |- (a.south);
endtikzpicture
Which produces this graph:
I would like to align the arrow tip direction at the center of A. Can you help me please?
tikz-pgf tikz-arrows
tikz-pgf tikz-arrows
asked Sep 10 at 20:27
ojenn
574
574
Change the second last line topath [draw, ->, ultra thick, dashed] (c.south) |- ([yshift=-20pt]a.south) -- (a.south);
. The reason why the arrow tip is turned is thata.south
is a tiny bit to the left of the coordinate that you are shifting to with++(0pt,-20pt) |- ++(-170pt,-20pt)
.
â Jasper Habicht
Sep 10 at 20:34
add a comment |Â
Change the second last line topath [draw, ->, ultra thick, dashed] (c.south) |- ([yshift=-20pt]a.south) -- (a.south);
. The reason why the arrow tip is turned is thata.south
is a tiny bit to the left of the coordinate that you are shifting to with++(0pt,-20pt) |- ++(-170pt,-20pt)
.
â Jasper Habicht
Sep 10 at 20:34
Change the second last line to
path [draw, ->, ultra thick, dashed] (c.south) |- ([yshift=-20pt]a.south) -- (a.south);
. The reason why the arrow tip is turned is that a.south
is a tiny bit to the left of the coordinate that you are shifting to with ++(0pt,-20pt) |- ++(-170pt,-20pt)
.â Jasper Habicht
Sep 10 at 20:34
Change the second last line to
path [draw, ->, ultra thick, dashed] (c.south) |- ([yshift=-20pt]a.south) -- (a.south);
. The reason why the arrow tip is turned is that a.south
is a tiny bit to the left of the coordinate that you are shifting to with ++(0pt,-20pt) |- ++(-170pt,-20pt)
.â Jasper Habicht
Sep 10 at 20:34
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
You've used the operation |-
too many times. These operation |-
makes it possible to draw two lines, the first vertical, the second horizontal.
First : You arrive at the bottom left, then just go directly to A with the operation line to
--
.
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(-170pt,-20pt) -- (a.south);
endtikzpicture
enddocument
Edit: In order to correct the vertical as noticed by @JasperHabicht
In order for the last arrow to be effectively vertical, a point under block A
can be defined with a distance of 20 pt
.
coordinate[below of=a,node distance=20pt](d);
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
coordinate[below of=a,node distance=20pt](d);
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(d) -| (a.south);
endtikzpicture
enddocument
1
Note that the last segment of the dashed line is slightly slanted. It may be better to shift down froma.south
usingyshift
for example. But nice answer (+1).
â Jasper Habicht
Sep 10 at 20:39
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
Sep 10 at 20:45
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
Sep 10 at 20:48
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
Sep 10 at 21:19
add a comment |Â
up vote
4
down vote
I would prefer to go without unnecessarily defining new coordinates.
documentclass[border=5pt,tikz]standalone
begindocument
tikzsetblock/.style=rectangle, draw, text width=2em, minimum height=2em
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
draw[->, ultra thick] (a) -- (b);
draw[->, ultra thick] (b) -- (c);
draw[->, ultra thick, dashed] (c.south) -- ++(0,-20pt) -| (a);
endtikzpicture
enddocument
1
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
Sep 10 at 23:25
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
You've used the operation |-
too many times. These operation |-
makes it possible to draw two lines, the first vertical, the second horizontal.
First : You arrive at the bottom left, then just go directly to A with the operation line to
--
.
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(-170pt,-20pt) -- (a.south);
endtikzpicture
enddocument
Edit: In order to correct the vertical as noticed by @JasperHabicht
In order for the last arrow to be effectively vertical, a point under block A
can be defined with a distance of 20 pt
.
coordinate[below of=a,node distance=20pt](d);
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
coordinate[below of=a,node distance=20pt](d);
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(d) -| (a.south);
endtikzpicture
enddocument
1
Note that the last segment of the dashed line is slightly slanted. It may be better to shift down froma.south
usingyshift
for example. But nice answer (+1).
â Jasper Habicht
Sep 10 at 20:39
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
Sep 10 at 20:45
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
Sep 10 at 20:48
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
Sep 10 at 21:19
add a comment |Â
up vote
5
down vote
accepted
You've used the operation |-
too many times. These operation |-
makes it possible to draw two lines, the first vertical, the second horizontal.
First : You arrive at the bottom left, then just go directly to A with the operation line to
--
.
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(-170pt,-20pt) -- (a.south);
endtikzpicture
enddocument
Edit: In order to correct the vertical as noticed by @JasperHabicht
In order for the last arrow to be effectively vertical, a point under block A
can be defined with a distance of 20 pt
.
coordinate[below of=a,node distance=20pt](d);
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
coordinate[below of=a,node distance=20pt](d);
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(d) -| (a.south);
endtikzpicture
enddocument
1
Note that the last segment of the dashed line is slightly slanted. It may be better to shift down froma.south
usingyshift
for example. But nice answer (+1).
â Jasper Habicht
Sep 10 at 20:39
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
Sep 10 at 20:45
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
Sep 10 at 20:48
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
Sep 10 at 21:19
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
You've used the operation |-
too many times. These operation |-
makes it possible to draw two lines, the first vertical, the second horizontal.
First : You arrive at the bottom left, then just go directly to A with the operation line to
--
.
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(-170pt,-20pt) -- (a.south);
endtikzpicture
enddocument
Edit: In order to correct the vertical as noticed by @JasperHabicht
In order for the last arrow to be effectively vertical, a point under block A
can be defined with a distance of 20 pt
.
coordinate[below of=a,node distance=20pt](d);
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
coordinate[below of=a,node distance=20pt](d);
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(d) -| (a.south);
endtikzpicture
enddocument
You've used the operation |-
too many times. These operation |-
makes it possible to draw two lines, the first vertical, the second horizontal.
First : You arrive at the bottom left, then just go directly to A with the operation line to
--
.
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(-170pt,-20pt) -- (a.south);
endtikzpicture
enddocument
Edit: In order to correct the vertical as noticed by @JasperHabicht
In order for the last arrow to be effectively vertical, a point under block A
can be defined with a distance of 20 pt
.
coordinate[below of=a,node distance=20pt](d);
documentclass[border=5pt,tikz]standalone
begindocument
tikzstyleblock = [rectangle, draw, text width=2em, minimum height=2em]
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
coordinate[below of=a,node distance=20pt](d);
path [draw, ->, ultra thick] (a) -- (b);
path [draw, ->, ultra thick] (b) -- (c);
path [draw, ->, ultra thick, dashed] (c.south) |- ++(d) -| (a.south);
endtikzpicture
enddocument
edited Sep 10 at 21:18
answered Sep 10 at 20:37
AndréC
3,336729
3,336729
1
Note that the last segment of the dashed line is slightly slanted. It may be better to shift down froma.south
usingyshift
for example. But nice answer (+1).
â Jasper Habicht
Sep 10 at 20:39
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
Sep 10 at 20:45
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
Sep 10 at 20:48
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
Sep 10 at 21:19
add a comment |Â
1
Note that the last segment of the dashed line is slightly slanted. It may be better to shift down froma.south
usingyshift
for example. But nice answer (+1).
â Jasper Habicht
Sep 10 at 20:39
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
Sep 10 at 20:45
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
Sep 10 at 20:48
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
Sep 10 at 21:19
1
1
Note that the last segment of the dashed line is slightly slanted. It may be better to shift down from
a.south
using yshift
for example. But nice answer (+1).â Jasper Habicht
Sep 10 at 20:39
Note that the last segment of the dashed line is slightly slanted. It may be better to shift down from
a.south
using yshift
for example. But nice answer (+1).â Jasper Habicht
Sep 10 at 20:39
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
Sep 10 at 20:45
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
Sep 10 at 20:45
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
Sep 10 at 20:48
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
Sep 10 at 20:48
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
Sep 10 at 21:19
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
Sep 10 at 21:19
add a comment |Â
up vote
4
down vote
I would prefer to go without unnecessarily defining new coordinates.
documentclass[border=5pt,tikz]standalone
begindocument
tikzsetblock/.style=rectangle, draw, text width=2em, minimum height=2em
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
draw[->, ultra thick] (a) -- (b);
draw[->, ultra thick] (b) -- (c);
draw[->, ultra thick, dashed] (c.south) -- ++(0,-20pt) -| (a);
endtikzpicture
enddocument
1
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
Sep 10 at 23:25
add a comment |Â
up vote
4
down vote
I would prefer to go without unnecessarily defining new coordinates.
documentclass[border=5pt,tikz]standalone
begindocument
tikzsetblock/.style=rectangle, draw, text width=2em, minimum height=2em
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
draw[->, ultra thick] (a) -- (b);
draw[->, ultra thick] (b) -- (c);
draw[->, ultra thick, dashed] (c.south) -- ++(0,-20pt) -| (a);
endtikzpicture
enddocument
1
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
Sep 10 at 23:25
add a comment |Â
up vote
4
down vote
up vote
4
down vote
I would prefer to go without unnecessarily defining new coordinates.
documentclass[border=5pt,tikz]standalone
begindocument
tikzsetblock/.style=rectangle, draw, text width=2em, minimum height=2em
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
draw[->, ultra thick] (a) -- (b);
draw[->, ultra thick] (b) -- (c);
draw[->, ultra thick, dashed] (c.south) -- ++(0,-20pt) -| (a);
endtikzpicture
enddocument
I would prefer to go without unnecessarily defining new coordinates.
documentclass[border=5pt,tikz]standalone
begindocument
tikzsetblock/.style=rectangle, draw, text width=2em, minimum height=2em
begintikzpicture[node distance = 3cm, auto]
node [block] (a) A;
node [block, right of=a] (b) B;
node [block, right of=b] (c) C;
draw[->, ultra thick] (a) -- (b);
draw[->, ultra thick] (b) -- (c);
draw[->, ultra thick, dashed] (c.south) -- ++(0,-20pt) -| (a);
endtikzpicture
enddocument
edited Sep 10 at 23:41
marmot
61.4k465133
61.4k465133
answered Sep 10 at 22:22
Diaa
2,3451642
2,3451642
1
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
Sep 10 at 23:25
add a comment |Â
1
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
Sep 10 at 23:25
1
1
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
Sep 10 at 23:25
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
Sep 10 at 23:25
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f450299%2fhow-to-correctly-align-arrow-tip%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Change the second last line to
path [draw, ->, ultra thick, dashed] (c.south) |- ([yshift=-20pt]a.south) -- (a.south);
. The reason why the arrow tip is turned is thata.south
is a tiny bit to the left of the coordinate that you are shifting to with++(0pt,-20pt) |- ++(-170pt,-20pt)
.â Jasper Habicht
Sep 10 at 20:34