Can you help me with my page of function graphs? I could make the first four graphs but there is a problem with plotting by others. All graphs should have the same size like the first four ones. Thank you!
\documentclass{article}
\usepackage{pgfplots}
\usepackage{subfigure}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,calc,arrows,decorations.markings,decorations.pathmorphing}
\newcommand{\tg}{\mathop{\mathrm{tg}}}
\newcommand{\cotg}{\mathop{\mathrm{cotg}}}
\newcommand{\arctg}{\mathop{\mathrm{arctg}}}
\newcommand{\arccotg}{\mathop{\mathrm{arccotg}}}
\begin{document}
\begin{figure}[H]
\centering
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{1}) node[above] {$y=c$};
\end{tikzpicture}
}
%
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=x$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x*\x}) node[above] {$y=x^2$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.15:1.15] plot (\x,{\x*\x*\x}) node[above] {$y=x^3$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\frac{1}{x}$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\sqrt{x}$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=e^x$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\ln{x}$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\sin(x)$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\cos(x)$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\tg(x)$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\cotg(x)$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\arcsin(x)$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\arccos(x)$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\arctg(x)$};
\end{tikzpicture}
}
%
\subfigure
{
\begin{tikzpicture}[smooth,scale=0.8]
\draw[thick,->] (-2,0) -- (2,0) node[below] {$x$};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[right] {$y$};
\draw[blue,thick,domain=-1.5:1.5] plot (\x,{\x}) node[above] {$y=\arccotg(x)$};
\end{tikzpicture}
}
\end{figure}
\end{document}




1/xand search the forum, you will see how to fix your domain problem for plot 5. Then you can use that idea about the domain for the others. NOTE: You have plotted ally = xfor the other plots was that intentional due to errors? If not, you are plotting the wrong function for the other plots. – dustin Sep 04 '13 at 22:17axisand\addplotfrompgfplots? This is much more convenient and you will get better results. – Gonzalo Medina Sep 04 '13 at 22:35