# Connecting normal lines with decorated ones

I've got a problem, I've tried it a lot and I've investigated about it but I haven't found the answer.

I've got a code like this....

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}
\draw[very thick, latex-] (0,8) -- (0,1);
\draw[very thick] decorate [decoration={zigzag}] {(0,1) -- (0,0)};
\draw[very thick, -latex] (0,0) -- (14,0);
\end{tikzpicture}
\end{document}


And I want to do a full \draw or \path joining the first \draw with the second one (the one with decoration) and the third, so the upper line connects with the zigzaged one at (0,1), then draw the decorated line and then at (0,0) connect this line with the other.

I would really appreciate the ideas.

-
Hi Paco, Welcome to TeX.SE! I edited your question to make your code into a complete MWE and I added a screenshot. It looks a little bit like you're creating an axis- if so, I recommend the pgfplots package. Welcome! –  cmhughes Oct 21 '12 at 17:40
Related (or even duplicate): tex.stackexchange.com/questions/18436/… –  egreg Oct 21 '12 at 22:22

## TikZ

You can decorate only one part of the path.

### Code

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}
\draw[very thick,latex-latex,decoration={zigzag}]
(0,8) -- (0,1) decorate {-- (0,0)} -- (14,0);
\end{tikzpicture}


Detail:

## pgfplots

As cmhughes already commented, you might be interested in the pgfplots package. The following example is taken from the manual.

### Code

\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line=bottom,
axis y line=center,
tick align=outside,
axis y discontinuity=crunch,
ymin=95, enlargelimits=false
]
blue,
mark=none,
domain=-4:4,
samples=20
]
{ x*x+x+104 };
\end{axis}
\end{tikzpicture}
\end{document}


-