How to make graphic caption rotate?

I have a large graph that has to fit the paper in the landscape mode, therefore I have to rotate the graph using includegraphics[angle=-90]. However, the usual \caption{} statement remains the same as before, so that even though the graph is rotated, the caption is not. Is there a way to rotate both the graph the its caption accordingly? Thanks a lot!

-

migrated from stackoverflow.comOct 18 '12 at 14:17

This question came from our site for professional and enthusiast programmers.

@mathematical.coffee: thank you so much for pointing this out! –  alittleboy Oct 15 '12 at 4:47
@Werner: thanks! –  alittleboy Oct 15 '12 at 5:20

\usepackage{rotating}

\begin{sidewaysfigure}...\end{sidewaysfigure}

-
thank you so much! that works perfectly :) –  alittleboy Oct 18 '12 at 16:07