Drawing multiple double headed arrows

The name of the pictureThe name of the pictureThe name of the pictureClash 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


enter image description here










share|improve this question



















  • 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















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


enter image description here










share|improve this question



















  • 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













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


enter image description here










share|improve this question















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


enter image description here







tikz-pgf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago

























asked 2 hours ago









Hany

850314




850314







  • 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













  • 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








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











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


enter image description here



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 edges (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



enter image description here



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.






share|improve this answer






















  • 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










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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
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%2f457103%2fdrawing-multiple-double-headed-arrows%23new-answer', 'question_page');

);

Post as a guest






























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


enter image description here



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 edges (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



enter image description here



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.






share|improve this answer






















  • 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














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


enter image description here



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 edges (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



enter image description here



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.






share|improve this answer






















  • 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












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


enter image description here



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 edges (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



enter image description here



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.






share|improve this answer














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


enter image description here



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 edges (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



enter image description here



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.







share|improve this answer














share|improve this answer



share|improve this answer








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
















  • 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

















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke