# Figure length and width

I would like to add a figure, but I would like to control both width and length of figure. I know to control length and width separately but not together. Could anyone let me know the command to do that.

I am using the following commands:

\begin{figure}[H]
\centering
\includegraphics[height=8cm]{Images/abc}
\caption{abc}
\label{fig:abc}
\end{figure}

• Welcome to TeX SX! You can use [height=…, width=…], but in general, it will change the aspect ratio of the figure. Jan 11, 2017 at 18:51
• Do you wish to maintain the aspect ratio? Do you want to have some maximum width/height to fit the image in rather than fixing it absolutely?
– Werner
Jan 11, 2017 at 20:16
• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Jan 12, 2017 at 20:30

Here you are:

\documentclass{report}
\usepackage[english]{babel}
\usepackage{graphicx}

\begin{document}
\includegraphics[height=3cm]{example-image-b}
\includegraphics[width=5cm]{example-image-b}

\includegraphics[height=3cm, width=3cm]{example-image-b}
\includegraphics[height=3cm, width=6cm]{example-image-b}
\includegraphics[keepaspectratio,height=3cm, width=6cm]{example-image-b}
\end{document}


And the result:

Be very careful! By defining both height and width, you will distort the aspect ratio of the images. See the manual of the graphics bundle for more details and how to avoid distortions. To avoid the distortion, you can use the keepaspectratio-option, as presented in the last command.