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.

  \tikz\draw [<-o] (0,0) node[pos=0, below] {$-3$}-- +(1,0);
  • 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? Jun 11 '14 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. :(
    – 46_and_2
    Jun 11 '14 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? Jun 11 '14 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?
    – 46_and_2
    Jun 11 '14 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. Jun 11 '14 at 6:05

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}

\usetikzlibrary{calc, positioning, decorations.pathmorphing}

  % 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)$);

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

EDIT: Shortened version (just for interest)

 \draw [<->, thick] (0,0) -- ++(2,0) decorate [decoration={zigzag, segment length=.1cm, amplitude=.1cm}] {-- ++(1,0)} -- ++(.15,0) node (circ) [draw, fill=white, circle, label={-90:-3}] {} -- ++(2,0);
 \draw [->, shorten <= .25cm] (1,-1) node [label={[label distance=-.5cm]-45:Some text goes here}] {} to [in=90, out=90, looseness=2] (circ);

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.