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'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}

enter image description here

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.

share|improve this question
1  
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

1 Answer 1

up vote 8 down vote accepted

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}

Output

TikZ solution

Detail:
Tikz solution: 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
]
    \addplot[
        blue,
        mark=none,
        domain=-4:4,
        samples=20
    ]
    { x*x+x+104 };
\end{axis}
\end{tikzpicture}
\end{document}

Output

pgfplots solution

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.