tikz align nodes

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












is it possible with TikZ to align a new node with respect to existing ones? I know the answer is affirmative in the case of one node using e.g. the node coordinate system, but what about align with respect to two nodes?



Example: suppose there are two nodes defined (A) and (B) and I want to create a third node (C) such that xy-coordinates satisfy C.x = A.x and C.y = B.y i.e. node (C) is vertically aligned with (B) and horizontally aligned with (A).







share|improve this question
















  • 2




    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code (with both cases mentioned), starting with documentclass... and ending with enddocument.
    – albert
    Aug 13 at 10:22














up vote
4
down vote

favorite












is it possible with TikZ to align a new node with respect to existing ones? I know the answer is affirmative in the case of one node using e.g. the node coordinate system, but what about align with respect to two nodes?



Example: suppose there are two nodes defined (A) and (B) and I want to create a third node (C) such that xy-coordinates satisfy C.x = A.x and C.y = B.y i.e. node (C) is vertically aligned with (B) and horizontally aligned with (A).







share|improve this question
















  • 2




    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code (with both cases mentioned), starting with documentclass... and ending with enddocument.
    – albert
    Aug 13 at 10:22












up vote
4
down vote

favorite









up vote
4
down vote

favorite











is it possible with TikZ to align a new node with respect to existing ones? I know the answer is affirmative in the case of one node using e.g. the node coordinate system, but what about align with respect to two nodes?



Example: suppose there are two nodes defined (A) and (B) and I want to create a third node (C) such that xy-coordinates satisfy C.x = A.x and C.y = B.y i.e. node (C) is vertically aligned with (B) and horizontally aligned with (A).







share|improve this question












is it possible with TikZ to align a new node with respect to existing ones? I know the answer is affirmative in the case of one node using e.g. the node coordinate system, but what about align with respect to two nodes?



Example: suppose there are two nodes defined (A) and (B) and I want to create a third node (C) such that xy-coordinates satisfy C.x = A.x and C.y = B.y i.e. node (C) is vertically aligned with (B) and horizontally aligned with (A).









share|improve this question











share|improve this question




share|improve this question










asked Aug 13 at 10:15









nicmus

623




623







  • 2




    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code (with both cases mentioned), starting with documentclass... and ending with enddocument.
    – albert
    Aug 13 at 10:22












  • 2




    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code (with both cases mentioned), starting with documentclass... and ending with enddocument.
    – albert
    Aug 13 at 10:22







2




2




Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code (with both cases mentioned), starting with documentclass... and ending with enddocument.
– albert
Aug 13 at 10:22




Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code (with both cases mentioned), starting with documentclass... and ending with enddocument.
– albert
Aug 13 at 10:22










1 Answer
1






active

oldest

votes

















up vote
5
down vote



accepted










You can achieve this using |- and -| along with node[midway]



documentclass[tikz]standalone

begindocument
begintikzpicture
node (A) at (0,0) A;
node (B) at (8,3) B;
path (A) |- (B) node[midway] (C) C;
path (A) -| (B) node[midway] (D) D;
endtikzpicture
enddocument





share|improve this answer
















  • 4




    Thank you! However looking at the -| and |- operators I found a shortcut in the manual which is the perpendicular coordinate system. One only needs to define node (C) at (A -| B) C;.
    – nicmus
    Aug 13 at 10:43











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%2f445851%2ftikz-align-nodes%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
5
down vote



accepted










You can achieve this using |- and -| along with node[midway]



documentclass[tikz]standalone

begindocument
begintikzpicture
node (A) at (0,0) A;
node (B) at (8,3) B;
path (A) |- (B) node[midway] (C) C;
path (A) -| (B) node[midway] (D) D;
endtikzpicture
enddocument





share|improve this answer
















  • 4




    Thank you! However looking at the -| and |- operators I found a shortcut in the manual which is the perpendicular coordinate system. One only needs to define node (C) at (A -| B) C;.
    – nicmus
    Aug 13 at 10:43















up vote
5
down vote



accepted










You can achieve this using |- and -| along with node[midway]



documentclass[tikz]standalone

begindocument
begintikzpicture
node (A) at (0,0) A;
node (B) at (8,3) B;
path (A) |- (B) node[midway] (C) C;
path (A) -| (B) node[midway] (D) D;
endtikzpicture
enddocument





share|improve this answer
















  • 4




    Thank you! However looking at the -| and |- operators I found a shortcut in the manual which is the perpendicular coordinate system. One only needs to define node (C) at (A -| B) C;.
    – nicmus
    Aug 13 at 10:43













up vote
5
down vote



accepted







up vote
5
down vote



accepted






You can achieve this using |- and -| along with node[midway]



documentclass[tikz]standalone

begindocument
begintikzpicture
node (A) at (0,0) A;
node (B) at (8,3) B;
path (A) |- (B) node[midway] (C) C;
path (A) -| (B) node[midway] (D) D;
endtikzpicture
enddocument





share|improve this answer












You can achieve this using |- and -| along with node[midway]



documentclass[tikz]standalone

begindocument
begintikzpicture
node (A) at (0,0) A;
node (B) at (8,3) B;
path (A) |- (B) node[midway] (C) C;
path (A) -| (B) node[midway] (D) D;
endtikzpicture
enddocument






share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 13 at 10:40









BambOo

2,173323




2,173323







  • 4




    Thank you! However looking at the -| and |- operators I found a shortcut in the manual which is the perpendicular coordinate system. One only needs to define node (C) at (A -| B) C;.
    – nicmus
    Aug 13 at 10:43













  • 4




    Thank you! However looking at the -| and |- operators I found a shortcut in the manual which is the perpendicular coordinate system. One only needs to define node (C) at (A -| B) C;.
    – nicmus
    Aug 13 at 10:43








4




4




Thank you! However looking at the -| and |- operators I found a shortcut in the manual which is the perpendicular coordinate system. One only needs to define node (C) at (A -| B) C;.
– nicmus
Aug 13 at 10:43





Thank you! However looking at the -| and |- operators I found a shortcut in the manual which is the perpendicular coordinate system. One only needs to define node (C) at (A -| B) C;.
– nicmus
Aug 13 at 10:43













 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f445851%2ftikz-align-nodes%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

How to combine Bézier curves to a surface?

Mutual Information Always Non-negative

Why am i infinitely getting the same tweet with the Twitter Search API?