Yes, thanks. The \scalebox needs to directly affect the \includegraphics command and so if you try to apply it to the whole figure environment (\begin{figure}...\end{figure}), then you will likely get an error since it will also try to scale the floats, captions, etc.
I think was needs to be pointed out is that the scalebox environment needs to be inside the figure environment if you are labeling the figure.
Yes, thanks.
The \scalebox needs to directly affect the \includegraphics command and so if you try to apply it to the whole figure environment (\begin{figure}...\end{figure}), then you will likely get an error since it will also try to scale the floats, captions, etc.