[Tex/LaTex] trim in includegraphics only stretches the image


I am using following code to crop left and right part of a certain image and including it.


\draft % marks overfull lines with a black rule on the right

\usepackage{graphicx, float}

\graphicspath{{figures/}} % Directory in which figures are stored


\fbox{\includegraphics[width = 0.95\columnwidth,trim = 2cm 0 2cm 0,clip]{patterndeath}}


Somehow, instead of trimming the left and right part of the figure, it simply stretches the image vertically. Is what am I doing right?

The original graph looks like this:

After usig trim option as given in the above code it looks like this one:

Thus, the left and right blank margins are still there, only image is stretched vertically.

Thank you

Update : I solved the problem now. Actually I was creating a .dvi file using the command
latex file.tex
In the dvi file so generated, the image is indeed stretched. But once I convert this file to pdf, everything is fine and trim works as expected.

Best Answer

The given MWE uses \fbox, but the frame is gone in the posted image. Also neither or trim or width without height distort an image. But, if both width and height are given, then the image is distorted, unless width and height are given in the correct ratio.

If both width and height are used/needed, then option keepaspectratio ensures that the proportions of the image are kept, e.g.:

  trim=2cm 0 2cm 0,