plotting the graph of hyperbolic tangent

Can someone help me to plot the graph of tanh in latex. I know I have to use pgfplot but I do not know actually how to use it. Any type of help is appreciated.

• Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. Have a look at the manual texdoc pgfplots which should give you plenty of examples - you should be able to copy and paste from it into a document on your system, which will give you a starting point – cmhughes May 8 '14 at 17:17

I'd definitely recommend using pgfplots:

Code:

\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc}
\usepackage{amsmath}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-2.5, xmax=2.5,
ymin=-1.5, ymax=1.5,
axis lines=center,
axis on top=true,
domain=-2.5:2.5,
ylabel=$y$,
xlabel=$x$,
]

\node [right, red] at (axis cs: 1,0.7) {$y = \tanh x$};