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
2 days ago
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 2 days ago
ojenn
524
524
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
2 days ago
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
2 days ago
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
2 days ago
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
2 days ago
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
2 days ago
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
2 days ago
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
2 days ago
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
2 days ago
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
2 days ago
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
2 days ago
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
2 days ago
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
2 days ago
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 2 days ago
answered 2 days ago
AndréC
3,084728
3,084728
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
2 days ago
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
2 days ago
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
2 days ago
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
2 days ago
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
2 days ago
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
2 days ago
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
2 days ago
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
2 days ago
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
2 days ago
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
2 days ago
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
2 days ago
@JasperHabicht Indeed, I have not changed the parameters of the question.
â AndréC
2 days ago
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
2 days ago
Thanks so much both of you! Jasper's answer is more dynamic, so I'm using it instead.
â ojenn
2 days ago
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
2 days ago
@JasperHabicht I have corrected the verticality, feel free to answer this question by correcting the verticality in your own way.
â AndréC
2 days ago
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
2 days ago
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
2 days ago
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 2 days ago
marmot
56.8k462124
56.8k462124
answered 2 days ago
Diaa
2,2431642
2,2431642
1
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
2 days ago
add a comment |Â
1
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
2 days ago
1
1
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
2 days ago
@marmot be my guest and edit it as you wish. I am not even remotely a TikZ answerer :)
â Diaa
2 days ago
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
2 days ago