Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[tikz] connection between nodes

10 views
Skip to first unread message

jean

unread,
May 24, 2011, 5:37:11 PM5/24/11
to
Hi,

I have the following nodes in my tikzpicture :

\node (A) at (15, -5) {A};
\node (canal) at (15, -15) {Canal};

I want to connect the south west of (A) by drawing a vertical line in
direction of (canal).

I did not find a way of doing that !

If i do

\draw [->] (A.south west) to (canal);

the line is not vertical (normal as it connects to the center of (canal))

If i do

\draw [->] (A.south west) to (canal.north west);

The line is not vertical as the width of (A) and (canal) are not identical

What I need is a way to say : draw a vertical line from A.south west in
direction of (canal).
Is it possible to do that ?

thanks !!!

Alan Munn

unread,
May 24, 2011, 7:35:31 PM5/24/11
to
In article <4ddc2507$0$25232$426a...@news.free.fr>,
jean <je...@pasdadresse.com> wrote:

You can add a minimum width to the two nodes to make them the same size.

\node[minimum width=1.25cm] (A) at (15, -5) {A};
\node[minimum width=1.25cm] (canal) at (15, -15) {Canal};

Now

\draw [->] (A.south west) to (canal.north west);

will do what you expect.

Alan

Alain Ketterlin

unread,
May 25, 2011, 3:07:11 AM5/25/11
to
jean <je...@pasdadresse.com> writes:

> I have the following nodes in my tikzpicture :
>
> \node (A) at (15, -5) {A};
> \node (canal) at (15, -15) {Canal};
>
> I want to connect the south west of (A) by drawing a vertical line in
> direction of (canal).

Yes, but how long should this line be? Depending on the answer to that
question, you may want to try either polar coordinates, e.g., (270:1cm),
or perpendiculars, e.g., (A |- canal).

-- Alain.

Paul Gaborit

unread,
May 25, 2011, 3:52:02 AM5/25/11
to

À (at) Tue, 24 May 2011 23:37:11 +0200,
jean <je...@pasdadresse.com> écrivait (wrote):

> Hi,
>
> I have the following nodes in my tikzpicture :
>
> \node (A) at (15, -5) {A};
> \node (canal) at (15, -15) {Canal};
>
> I want to connect the south west of (A) by drawing a vertical line in
> direction of (canal).

\draw[->] (A.south west) -- (canal.north -| A.south west);

--
Paul Gaborit - <http://perso.mines-albi.fr/~gaborit/>

jean

unread,
May 25, 2011, 5:43:33 AM5/25/11
to
Le 25/05/11 09:52, Paul Gaborit a écrit :

>
> À (at) Tue, 24 May 2011 23:37:11 +0200,
> jean<je...@pasdadresse.com> écrivait (wrote):
>
>> Hi,
>>
>> I have the following nodes in my tikzpicture :
>>
>> \node (A) at (15, -5) {A};
>> \node (canal) at (15, -15) {Canal};
>>
>> I want to connect the south west of (A) by drawing a vertical line in
>> direction of (canal).
>
> \draw[->] (A.south west) -- (canal.north -| A.south west);
>

Super ! it works as I need.

If I understand well, (canal.north -| A.south west) means the point that
is at intersection of

- the horizontal line passing through the north point of canal
with
- the vertical line passing through the south west point of A

?

Thanks a lot

--
Le stade rennais m'a tuer©

jean

unread,
May 25, 2011, 5:44:25 AM5/25/11
to
Le 25/05/11 01:35, Alan Munn a écrit :

Yep but it is not what I want.

Thanks for your reply.

jean

unread,
May 25, 2011, 5:45:41 AM5/25/11
to
Le 25/05/11 09:07, Alain Ketterlin a écrit :

The line should stop ... when it reaches (canal).
The solution proposed by Paul Gaborit works well.

Paul Gaborit

unread,
May 25, 2011, 7:06:07 AM5/25/11
to

À (at) Wed, 25 May 2011 11:43:33 +0200,
jean <je...@pasdadresse.com> écrivait (wrote):

> If I understand well, (canal.north -| A.south west) means the point


> that is at intersection of
>
> - the horizontal line passing through the north point of canal
> with
> - the vertical line passing through the south west point of A
>
> ?

Exactly.

jean

unread,
May 25, 2011, 7:20:23 AM5/25/11
to
Le 25/05/11 13:06, Paul Gaborit a écrit :

>
> À (at) Wed, 25 May 2011 11:43:33 +0200,
> jean<je...@pasdadresse.com> écrivait (wrote):
>
>> If I understand well, (canal.north -| A.south west) means the point
>> that is at intersection of
>>
>> - the horizontal line passing through the north point of canal
>> with
>> - the vertical line passing through the south west point of A
>>
>> ?
>
> Exactly.
>
>

Thanks a lot.
I did not catch that when reading the doc.

Alan Munn

unread,
May 25, 2011, 11:14:41 AM5/25/11
to
In article <4ddccf7a$0$27742$426a...@news.free.fr>,
jean <je...@pasdadresse.com> wrote:

Sorry, it wasn't entirely clear that this wasn't what you wanted,
otherwise I would have suggested what Paul did.

Alan

0 new messages