# Plot non-continuous function with TikZ

How can I plot a non-continuous function with TikZ (using continuous lines for continous stretches of the function and dashed lines for discontinuities)? Does anybody know an efficient method?

-
–  cmhughes Oct 12 '12 at 15:39

I am not sure if this is what you want, but I would suggest you to use the pgfplots package (internally uses TikZ); a little example (the solid and hollow dot styles are borrowed from a comment by cmhughes):

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.6}

\pgfplotsset{soldot/.style={color=blue,only marks,mark=*}} \pgfplotsset{holdot/.style={color=blue,fill=white,only marks,mark=*}}

\begin{document}

\begin{tikzpicture}
\begin{axis}