Drawing multiple double headed arrows
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
I used the following code to draw multiple double-headed arrows.
When I used one single draw
command, only the last line has double-headed arrow.
But when I used multiple draw
commands, all lines have double-headed arrows. Why was that?
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintikzpicture[transform shape]
draw [ultra thick, blue, latex' -latex'] (0,2) -- +(0:1.2cm) (2,2) -- +(0:1.2cm) (4,2) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (0,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (2,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (4,1) -- +(0:1.2cm);
endtikzpicture
endframe
enddocument
tikz-pgf
add a comment |Â
up vote
4
down vote
favorite
I used the following code to draw multiple double-headed arrows.
When I used one single draw
command, only the last line has double-headed arrow.
But when I used multiple draw
commands, all lines have double-headed arrows. Why was that?
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintikzpicture[transform shape]
draw [ultra thick, blue, latex' -latex'] (0,2) -- +(0:1.2cm) (2,2) -- +(0:1.2cm) (4,2) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (0,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (2,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (4,1) -- +(0:1.2cm);
endtikzpicture
endframe
enddocument
tikz-pgf
2
If you replace in the firstdraw
command--
by edge, i.e.draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row,
â marmot
1 hour ago
1
Thank you very much. Can you please tell me why?
â Hany
1 hour ago
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I used the following code to draw multiple double-headed arrows.
When I used one single draw
command, only the last line has double-headed arrow.
But when I used multiple draw
commands, all lines have double-headed arrows. Why was that?
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintikzpicture[transform shape]
draw [ultra thick, blue, latex' -latex'] (0,2) -- +(0:1.2cm) (2,2) -- +(0:1.2cm) (4,2) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (0,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (2,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (4,1) -- +(0:1.2cm);
endtikzpicture
endframe
enddocument
tikz-pgf
I used the following code to draw multiple double-headed arrows.
When I used one single draw
command, only the last line has double-headed arrow.
But when I used multiple draw
commands, all lines have double-headed arrows. Why was that?
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintikzpicture[transform shape]
draw [ultra thick, blue, latex' -latex'] (0,2) -- +(0:1.2cm) (2,2) -- +(0:1.2cm) (4,2) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (0,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (2,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (4,1) -- +(0:1.2cm);
endtikzpicture
endframe
enddocument
tikz-pgf
tikz-pgf
edited 1 hour ago
asked 2 hours ago
Hany
850314
850314
2
If you replace in the firstdraw
command--
by edge, i.e.draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row,
â marmot
1 hour ago
1
Thank you very much. Can you please tell me why?
â Hany
1 hour ago
add a comment |Â
2
If you replace in the firstdraw
command--
by edge, i.e.draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row,
â marmot
1 hour ago
1
Thank you very much. Can you please tell me why?
â Hany
1 hour ago
2
2
If you replace in the first
draw
command --
by edge, i.e. draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row,â marmot
1 hour ago
If you replace in the first
draw
command --
by edge, i.e. draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row,â marmot
1 hour ago
1
1
Thank you very much. Can you please tell me why?
â Hany
1 hour ago
Thank you very much. Can you please tell me why?
â Hany
1 hour ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
If you replace in the first draw
command the first two --
by edge
, i.e. draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintikzpicture[transform shape]
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge
+(0:1.2cm) (4,2) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (0,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (2,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (4,1) -- +(0:1.2cm);
endtikzpicture
endframe
enddocument
The results are different since in the first row of your example you have just one path, and instruct TikZ to insert arrow heads at its start and end. On the other hand, an edge
is a new path, so each of these edges will have arrow heads at their start and end positions. I personally do not work with edges that much because I find them slightly confusing. To see that, replace all --
by edge
s (as I did in the first version of my comment),
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) edge +(0:1.2cm);
Then you'll get
There is an excess vertical arrow, which you noted yourself. This is because there is essentially an empty path consisting just of one point, (4,2)
. Why this is the point TikZ takes the path to be, and not, say, (0,2)
I do not 100% understand, but this is the reason why I do not like to use edges too much and think your serious of draw
commands is cleaner.
Thank you for your answer and explanation.
â Hany
1 hour ago
Thank you very much for your time.
â Hany
1 hour ago
@Hany You're welcome!
â marmot
1 hour ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
If you replace in the first draw
command the first two --
by edge
, i.e. draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintikzpicture[transform shape]
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge
+(0:1.2cm) (4,2) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (0,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (2,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (4,1) -- +(0:1.2cm);
endtikzpicture
endframe
enddocument
The results are different since in the first row of your example you have just one path, and instruct TikZ to insert arrow heads at its start and end. On the other hand, an edge
is a new path, so each of these edges will have arrow heads at their start and end positions. I personally do not work with edges that much because I find them slightly confusing. To see that, replace all --
by edge
s (as I did in the first version of my comment),
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) edge +(0:1.2cm);
Then you'll get
There is an excess vertical arrow, which you noted yourself. This is because there is essentially an empty path consisting just of one point, (4,2)
. Why this is the point TikZ takes the path to be, and not, say, (0,2)
I do not 100% understand, but this is the reason why I do not like to use edges too much and think your serious of draw
commands is cleaner.
Thank you for your answer and explanation.
â Hany
1 hour ago
Thank you very much for your time.
â Hany
1 hour ago
@Hany You're welcome!
â marmot
1 hour ago
add a comment |Â
up vote
4
down vote
accepted
If you replace in the first draw
command the first two --
by edge
, i.e. draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintikzpicture[transform shape]
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge
+(0:1.2cm) (4,2) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (0,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (2,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (4,1) -- +(0:1.2cm);
endtikzpicture
endframe
enddocument
The results are different since in the first row of your example you have just one path, and instruct TikZ to insert arrow heads at its start and end. On the other hand, an edge
is a new path, so each of these edges will have arrow heads at their start and end positions. I personally do not work with edges that much because I find them slightly confusing. To see that, replace all --
by edge
s (as I did in the first version of my comment),
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) edge +(0:1.2cm);
Then you'll get
There is an excess vertical arrow, which you noted yourself. This is because there is essentially an empty path consisting just of one point, (4,2)
. Why this is the point TikZ takes the path to be, and not, say, (0,2)
I do not 100% understand, but this is the reason why I do not like to use edges too much and think your serious of draw
commands is cleaner.
Thank you for your answer and explanation.
â Hany
1 hour ago
Thank you very much for your time.
â Hany
1 hour ago
@Hany You're welcome!
â marmot
1 hour ago
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
If you replace in the first draw
command the first two --
by edge
, i.e. draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintikzpicture[transform shape]
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge
+(0:1.2cm) (4,2) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (0,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (2,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (4,1) -- +(0:1.2cm);
endtikzpicture
endframe
enddocument
The results are different since in the first row of your example you have just one path, and instruct TikZ to insert arrow heads at its start and end. On the other hand, an edge
is a new path, so each of these edges will have arrow heads at their start and end positions. I personally do not work with edges that much because I find them slightly confusing. To see that, replace all --
by edge
s (as I did in the first version of my comment),
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) edge +(0:1.2cm);
Then you'll get
There is an excess vertical arrow, which you noted yourself. This is because there is essentially an empty path consisting just of one point, (4,2)
. Why this is the point TikZ takes the path to be, and not, say, (0,2)
I do not 100% understand, but this is the reason why I do not like to use edges too much and think your serious of draw
commands is cleaner.
If you replace in the first draw
command the first two --
by edge
, i.e. draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintikzpicture[transform shape]
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge
+(0:1.2cm) (4,2) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (0,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (2,1) -- +(0:1.2cm);
draw [ultra thick, blue, latex' -latex'] (4,1) -- +(0:1.2cm);
endtikzpicture
endframe
enddocument
The results are different since in the first row of your example you have just one path, and instruct TikZ to insert arrow heads at its start and end. On the other hand, an edge
is a new path, so each of these edges will have arrow heads at their start and end positions. I personally do not work with edges that much because I find them slightly confusing. To see that, replace all --
by edge
s (as I did in the first version of my comment),
draw [ultra thick, blue, latex'-latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) edge +(0:1.2cm);
Then you'll get
There is an excess vertical arrow, which you noted yourself. This is because there is essentially an empty path consisting just of one point, (4,2)
. Why this is the point TikZ takes the path to be, and not, say, (0,2)
I do not 100% understand, but this is the reason why I do not like to use edges too much and think your serious of draw
commands is cleaner.
edited 1 hour ago
manooooh
6831212
6831212
answered 1 hour ago
marmot
69.1k476148
69.1k476148
Thank you for your answer and explanation.
â Hany
1 hour ago
Thank you very much for your time.
â Hany
1 hour ago
@Hany You're welcome!
â marmot
1 hour ago
add a comment |Â
Thank you for your answer and explanation.
â Hany
1 hour ago
Thank you very much for your time.
â Hany
1 hour ago
@Hany You're welcome!
â marmot
1 hour ago
Thank you for your answer and explanation.
â Hany
1 hour ago
Thank you for your answer and explanation.
â Hany
1 hour ago
Thank you very much for your time.
â Hany
1 hour ago
Thank you very much for your time.
â Hany
1 hour ago
@Hany You're welcome!
â marmot
1 hour ago
@Hany You're welcome!
â marmot
1 hour 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%2f457103%2fdrawing-multiple-double-headed-arrows%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
2
If you replace in the first
draw
command--
by edge, i.e.draw [ultra thick, blue, latex' -latex'] (0,2) edge +(0:1.2cm) (2,2) edge +(0:1.2cm) (4,2) -- +(0:1.2cm);
, you'll get the same result as in the second row,â marmot
1 hour ago
1
Thank you very much. Can you please tell me why?
â Hany
1 hour ago