4

Referencing this very helpful posts and the Tikz manual, which states:

Whenever TikZ encounters a whole node name as a “coordinate,” it tries to “be smart” about the anchor that it should choose for this node. Depending on what happens next, TikZ will choose an anchor that lies on the border of the node on a line to the next coordinate or control point.

I can see the difference in the way the following two paths are drawn:

Paths between nodes vs. coordinates

The second path is the preferred one. My question is if there is a better way to integrate this into fewer commands. I cannot seem to get a "point" drawn using the shape=coordinate inside node[], and instead am drawing the actual points using filldraw.

\documentclass[border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{arrows,backgrounds,patterns,shapes.geometric,calc,positioning} \begin{document} \begin{tikzpicture}[scale=1,auto] [bend angle=45] \node[name=f,shape=ellipse,draw, thick, minimum width=50, minimum height=75] at (0,0) {}; \node[name=g,shape=ellipse,draw, thick, minimum width=50, minimum height=75] at (2,0) {}; \coordinate(f1) at ($(f.center) + (0,1)$); \coordinate(g1) at ($(g.center) + (0,1)$); \node at ($(f.center) + (0,-1)$) (f3) {}; \node at ($(g.center) + (0,-1)$) (g3) {}; \filldraw (f1) circle (1pt) (f3) circle (1pt) (g1) circle (1pt) (g3) circle (1pt); \draw[->, >=stealth,bend left] (f1) to (g1); \draw[->, >=stealth,bend left] (f3) to (g3); \end{tikzpicture} \end{document} 

1 Answer 1

5

If you daw the nodes you made you will understand that in one case you connect points in the other one you connect "boxes" aka nodes :

\documentclass[border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{arrows,backgrounds,patterns,shapes.geometric,calc,positioning} \tikzset{small dot/.style={fill=black,circle,scale=0.25}} \begin{document} \begin{tikzpicture}[scale=1,auto] [bend angle=45] \node[name=f,shape=ellipse,draw, thick, minimum width=50, minimum height=75] at (0,0) {}; \node[name=g,shape=ellipse,draw, thick, minimum width=50, minimum height=75] at (2,0) {}; \coordinate(f1) at ($(f.center) + (0,1)$); \coordinate(g1) at ($(g.center) + (0,1)$); \node[small dot] at ($(f.center) + (0,-1)$) (f3) {}; \node[small dot,outer sep=3pt] at ($(g.center) + (0,-1)$) (g3) {}; \filldraw (f1) circle (1pt) %(f3) circle (1pt) (g1) circle (1pt) %(g3) circle (1pt) ; \draw[->, >=stealth,bend left] (f1) to (g1); \draw[->, >=stealth,bend left] (f3) to (g3); \end{tikzpicture} \end{document} 

enter image description here

5
  • Man that was fast! I should've specified, I understand this already. What I would like to do is draw a point inside the node within the parameters of 'node' itself, if possible, rather than filldraw circles. Commented Oct 11, 2014 at 17:34
  • @AbbasJaffary See my edit. Commented Oct 11, 2014 at 17:44
  • outer sep is for this purpose Commented Oct 11, 2014 at 18:00
  • You mean '\coordinate[draw]'? I tried that and nothing shows up. Commented Oct 11, 2014 at 19:10
  • @AbbasJaffary No I don't mean that. Did I understand correctly what you want in my answer ? You can put the outer sep=3pt in the style, if you want to use it every time. Commented Oct 11, 2014 at 19:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.