3

Would you please help me in drawing two circles with a line (middle arrow) connecting them.

O-->--O

Sorry I could not post the image.

Edit* Thank you so much.

Can you help me more? Here is my code. I need to draw that mid-arrowed line between the dot-filled circles.

Thank you

\begin{tikzpicture}
\draw [dotted] (0,1) -- (0,10);
\draw [dotted] (1.5,1.3) -- (1.5,10);
\draw [dotted] (3.0,1.3) -- (3.0,10);
\draw [dotted] (4.5,1.3) -- (4.5,10);
\draw [dotted] (6.0,1.3) -- (6.0,10);
\draw [dotted] (7.5,1.3) -- (7.5,10);

% Lower Row
\filldraw[pattern=dots] (7.5,1) circle (0.2) ;
\filldraw[pattern=dots] (6.0,1) circle (0.2);
\filldraw[pattern=dots] (4.5,1) circle (0.2);
\draw (3.0,1) circle (0.2);
\end{tikzpicture}
OOzy Pal
  • 1,571

2 Answers2

7

Something like this?

\input tikz
\usetikzlibrary{decorations.markings}
\tikzset{circ/.style={circle, draw, fill=white},
  conn/.style={postaction=decorate, decoration={
    markings, mark=at position .55 with {\arrow{stealth}}}}}

\tikz\draw[conn] (0,0) node[circ]{} -- +(1,0) node[circ]{};
\bye

enter image description here

morbusg
  • 25,490
  • 4
  • 81
  • 162
  • the description in the question sounds to me like a dynkin diagram. if that's the case, the circles here are much larger than the usual in such diagrams, and/or the arrowhead much smaller. – barbara beeton Dec 18 '12 at 14:05
  • @barbara: Yes, then it is more difficult (not the size of the circles; that could just be a, say, inner sep=.75ex, but all the other dynkin diagram reqs, like double lines with large angle arrows etc.) – morbusg Dec 20 '12 at 06:50
3

Here is a modification of your posted code with the arrows added.

Sample output

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{patterns,calc}

\begin{document}
\begin{tikzpicture}
  \draw [dotted] (0,1) -- (0,10);
  \draw [dotted] (1.5,1.3) -- (1.5,10);
  \draw [dotted] (3.0,1.3) -- (3.0,10);
  \draw [dotted] (4.5,1.3) -- (4.5,10);
  \draw [dotted] (6.0,1.3) -- (6.0,10);
  \draw [dotted] (7.5,1.3) -- (7.5,10);

  % Lower Row
  \draw[pattern=dots] (7.5,1) node[circle,minimum size=0.4cm,draw,fill] (A) {};
  \draw[pattern=dots] (6.0,1) node[circle,minimum size=0.4cm,draw,fill] (B) {};
  \draw[pattern=dots] (4.5,1) node[circle,minimum size=0.4cm,draw,fill] (C) {};
  \draw (3.0,1) circle (0.2);

  % Arrows
  \draw[->] (B.east) -- ($(B.east)!0.5!(A.west)$);
  \draw ($(B.east)!0.5!(A.west)$) -- (A.west);
  \draw[->] (C.east) -- ($(C.east)!0.5!(B.west)$);
  \draw ($(C.east)!0.5!(B.west)$) -- (B.west);
\end{tikzpicture}

\end{document}

The main change is to turn the circles in to nodes that are labelled. We can then refer to anchor positions such as A.west for attaching the lines.

Andrew Swann
  • 95,762