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 want to draw the following number line diagram. How can I do this?

enter image description here Thanks. Please disregard the stray mark under the word 'some'. :)

Here is what I am able to do.

  \documentclass{article}
  \usepackage{tikz}
  \usetikzlibrary{arrows}
  \begin{document}
  \tikz\draw [<-o] (0,0) node[pos=0, below] {$-3$}-- +(1,0);
  \end{document}
share|improve this question
1  
You can do this with tikz. Please make an attempt and post a specific question as to where you are stuck. For instance, can you draw the horizontal line? If so, can you add the circle? the label?, the arrow? the squiggly line? –  Peter Grill Jun 11 at 5:50
    
I am afraid I do not know how to do any of these. I know very little tikz. I've looked at a few question such as this and tried to figure it out. But it doesn't work out. :( –  Marcos Rojo Jun 11 at 5:58
    
So it is the squiggly you are having difficulty with. Can you at least have a look at the tikz manual and draw the straight line? –  Peter Grill Jun 11 at 6:00
    
Yes, I can draw the straight line. The squiggly line and the arrow pointing towards the text I'm stuck with. Also, how do I insert the number 3 on there? –  Marcos Rojo Jun 11 at 6:02
1  
Ok, then please edit the question and post a fully compilable MWE including \documentclass and shows how far you can got and ask a specific question about the squiggly and the arrow. That way those trying to help have something to start with. –  Peter Grill Jun 11 at 6:05

1 Answer 1

up vote 16 down vote accepted

I'll post a working code example here. Take this code as a starting point using the possibilities you have with tikz and its libraries. For detailed informations about the used parts please have a look at the pgfmanual.

Important: It's worth looking at the Example Sections of the pgfmanual to get some good point to start with. Quite all the information you need for this can be found there.

\documentclass[border=6mm, 11pt]{standalone}

\usepackage{tikz}
\usetikzlibrary{calc, positioning, decorations.pathmorphing}

\begin{document}
 \begin{tikzpicture}
  % Circle node
  \node at (0,0) [circle, draw, thick, label={-90:-3}] (circ) {};
  % Left side with zigzag part
  \draw [thick, ->, >=latex] (circ) decorate [decoration={zigzag, segment length=.1cm, amplitude=.1cm}] {-- ++(-1,0)} -- ++(-2,0);
  % Right side
  \draw [thick, ->, >=latex] (circ) -- ++(2,0);
  % Text node with arrow to zigzag part
  \node at (-2,-1) [label={[label distance=-.5cm]-45:Some text goes here}] (text) {};
  \draw [->] (text) to [looseness=2, in=90, out=90] ($(circ.north)+(-.5,0)$);
 \end{tikzpicture}
\end{document}

The code will give you the following image: enter image description here

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.