I would like to ask you if you have something like graphs of elementary functions on one page made in TikZ. I write thesis and I would like to get inspired by your code and design. It would be very helpful.
Thank you!
I would like to ask you if you have something like graphs of elementary functions on one page made in TikZ. I write thesis and I would like to get inspired by your code and design. It would be very helpful.
Thank you!
You can use the powerful pgfplots package; the documentation is full with examples for inspiration. Below a present just a small selection of graphs of trigonometric, exponential and rational functions. In the example I show different styles for the axis, ticks, labels, titles, descriptions, grids:
\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\tikzset{
every pin/.style={fill=yellow!50!white,rectangle,rounded corners=3pt},
small dot/.style={fill=black,circle,inner sep=1pt}
}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
enlargelimits=false,
axis lines=middle,
xtick={-6.28318, -3.15159265, ..., 6.28318},
xticklabels={$-2\pi$,$-\pi$,0,$\pi$,$2\pi$},
grid=major,
legend style={legend pos=outer north east}
]
\addplot+[no marks,domain=-2*pi:2*pi, samples=100]{cos(deg(x))};
\addlegendentry{$f(x)=\cos(x)$}
\addplot+[no marks,domain=-2*pi:2*pi, samples=100]{sin(deg(x))};
\addlegendentry{$g(x)=\sin(x)$}
\end{axis}
\end{tikzpicture}\par\bigskip
\begin{tikzpicture}
\begin{axis}[
enlargelimits=false,
axis lines=middle,
legend style={legend pos=outer north east},
extra x ticks={2},
extra x tick style={grid=major}
]
\addplot+[no marks,domain=-8:12,unbounded coords=jump,samples=101]{(x-2)^(-1)};
\node[small dot,pin=60:{$f(x)=(x-2)^{-1}$}] at (axis cs:3,1) {};
\end{axis}
\end{tikzpicture}\par\bigskip
\begin{tikzpicture}
\begin{axis}[
xmin=0,
xmax=3,
ymin=0,
ymax=15,
samples=100,
extra y ticks={2.71828},
extra y tick labels={$e$},
title={Graph of $h(x)=e^{x}$}
]
\addplot[no marks,cyan] {exp(x)};
\draw[dashed] (axis cs:1,0) -- (axis cs:1,2.71828);
\draw[dashed] (axis cs:0,2.71828) -- (axis cs:1,2.71828);
\node[small dot,fill=red] at (axis cs:1,2.71828) {};
\end{axis}
\end{tikzpicture}
\end{document}

sin,cosetc., logarithm and the exponential? – kan Aug 31 '13 at 18:13