I have a figure with 3 subfigures. I used the \ref{fig:2} in my text and I got 2a. Can anyone knows how to make it 2(a) instead of 2a?
Below is an example of my code:
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{graph1.jpg}
\caption{$y=x$}
\label{fig:1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{graph2.jpg}
\caption{$y=sinx$}
\label{fig:2}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{graph3.jpg}
\caption{$y=cosx$}
\label{fig:3}
\end{subfigure}
\caption{Three simple graphs}
\label{fig:three graphs}
\end{figure}
\end{document}
With Thanks

\documentclass{...}and ending with\end{document}. – Jan 02 '15 at 11:13\renewcommand{\thesubfigure}{(\alph{subfigure})}and\captionsetup[sub]{labelformat=simple}are sufficient. – egreg Jan 02 '15 at 12:31