Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I drawed a simple path in graph

\begin{center}
\begin{tikzpicture}
\tikzstyle{every node}=[draw,shape=circle]
\draw[xshift=-1cm] (-2,0) node[circle,fill,inner sep=1pt,label=below:$x$](x){};
\draw[xshift=-1cm] (-1,0) node[circle,fill,inner sep=1pt,label=below:$y$](y){};
\draw[xshift=-1cm] (0,0) node[circle,fill,inner sep=1pt,label=below:$z$](z){};
\draw[xshift=-1cm] (1,0) node[circle,fill,inner sep=1pt,label=below:$k$](k){};
\draw (x) -- (k);
\end{tikzpicture}
\end{center}
\end{document}

But I need to draw more 3 vertex on this path (between y and z) enter image description here

I tried the \fill [dot] (x) circle (.3mm); but it doesnot work. Can you help me plz?

share|improve this question
2  
Just FYI for the future: the end result of using xshift on everything is that the shift has no effect on the appearance of the graphic. –  Paul Gessler Jun 28 at 20:41

1 Answer 1

up vote 5 down vote accepted

You could simply use a a dotted line:

\documentclass[tikz]{standalone}

\begin{document}

\begin{tikzpicture}
  \tikzstyle{every node}=[draw,shape=circle]
  \draw[xshift=-1cm] (-2,0) node[circle,fill,inner sep=1pt,label=below:$x$](x){};
  \draw[xshift=-1cm] (-1,0) node[circle,fill,inner sep=1pt,label=below:$y$](y){};
  \draw[xshift=-1cm] ( 0,0) node[circle,fill,inner sep=1pt,label=below:$z$](z){};
  \draw[xshift=-1cm] ( 1,0) node[circle,fill,inner sep=1pt,label=below:$k$](k){};
  \draw (x) -- (y);
  \draw[dotted] (y) -- (z);
  \draw (z) -- (k);
\end{tikzpicture}

\end{document}

enter image description here

To increase the spacing between the dots, add the following to the tikzpicture options:

dotted/.style={dash pattern=on \pgflinewidth off 5pt}

where 5pt ist the new spacing.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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