\usepackage{tikz}
\usepackage{pgfplots}
\begin{tikzpicture}
\begin{axis}%
[grid=both,
minor tick num=5,
grid style={line width=.1pt, draw=gray!10},
major grid style={line width=.2pt,draw=gray!50},
axis lines=middle,
enlargelimits={abs=0.2}
]
\addplot[domain=-1:1,samples=100,smooth,red] {sin(deg(pi*x))};
\addplot coordinates {
(0,0)
(1,1)
};
\end{axis}
\end{tikzpicture}