1

I have the following tikz picture I created:

\documentclass[tikz]{standalone}
\begin{document}
    \begin{tikzpicture}[auto=left,every node/.style={circle,thick,minimum size=5pt}]

      \draw node (n1) at (20,6) {X};
      \draw node (n2) at (9,6)  {Y};

      \draw (n1) -- (n2);

    \end{tikzpicture}
\end{document}

I want to make a few changes. First, I want the node to be a filled-in circular black dot, not too big (perhaps half of the width of the text next to the node) -- just like you would expect when drawing a graph. I couldn't get it to work, no matter what I did, the "dot" was quite big or in this version -- is not there at all. Rescaling re-scaled the whole thing to be small.

I would also like to add a label to the edge.

  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – jub0bs Oct 12 '14 at 9:49
  • 1
    thanks for the feedback, @Jubobs. I already got a good response, but I edited the question to add the headers. – kloop Oct 12 '14 at 10:22
  • That's much better :) – jub0bs Oct 12 '14 at 10:25
3
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[]
  \node[label=west:X,circle,fill,inner sep=1.5pt] (n1) at (0,0) {};
  \node[label=east:Y,circle,fill,inner sep=1.5pt] (n2) at (1,0) {};
  \draw (n1) -- (n2);
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.