[Tex/LaTex] Both scale and reduce height of graphics

graphicsscaling

This is how i add the graph in latexila

 \centerline{\includegraphics[scale=0.5]{e1.png}}

Question is can I also reduce its height after I scale it?

The reason I want to do this is because I don't want to change the height of the png .

Best Answer

This can be achieved by putting your \includegraphics command inside of a \resizebox.

\resizebox{\width}{1cm}{\includegraphics[scale=0.5]{e1.png}}

will resize your graphic to maintain its original (after scaling) width, but have a height of 1cm. Here's an example:

\documentclass{article}
\usepackage{graphicx}
\begin{document}

\includegraphics{wikipedia.jpg}
\includegraphics[scale=0.5]{wikipedia.jpg}   
\resizebox{\width}{1cm}{\includegraphics[scale=0.55]{wikipedia.jpg}}

\end{document}

enter image description here