I want to plot few functions with tikz. Values of some of them grows too huge. In tikz manual there is an example with "nice" functions that do not grow too much:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[domain=0:4]
\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
\draw[color=red] plot (\x,\x) node[right] {$f(x) =x$};
\draw[color=blue] plot (\x,{sin(\x r)}) node[right] {$f(x) = \sin x$};
\draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x) =q\frac{1}{20} \mathrm e^x$};
\end{tikzpicture}
\end{document}
How to modify this so that only y-values from -1 to 4 are (still) shown, but instead of 0.05*e^x there is e^x shown?
I know that this is quite impossible if function oscillates. But let's suppose that we are plotting function with one local minimun or no minimun at all.


restrict y to domain=-1:4. Do you have a particular reason for wanting to draw your plots using "raw" TikZ? – Jake Dec 02 '13 at 12:43\documentclass{...}and ending with\end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to help you. Help them help you: remove that one hurdle between you and a solution to your problem. – jub0bs Dec 02 '13 at 12:44