[Tex/LaTex] Proper use of bounding box (bb) option of \includegraphics

graphics

What is the correct way of using bounding box (bb) option of \includegraphics?

I have tried several options with different sample files with no luck.

My MWE:

\documentclass[]{article}
\usepackage{graphicx}
\begin{document}
   \noindent
   \fbox{\includegraphics[bb=0 0 200 30]{temp.png}}\\
   \fbox{\includegraphics[bb=0 0 200 30]{fig.png}}\\
   \fbox{\includegraphics[bb=0 0 200 30]{fig.pdf}}\\
   \fbox{\includegraphics[bb=0 0 7cm 2cm]{fig.pdf}}\\
   \fbox{\includegraphics[]{fig.pdf}}
\end{document}

Output:

enter image description here

All graphics files in the above MWE can be downloaded from my OneDrive folder:

https://1drv.ms/f/s!Aqx30_D8oGfG2RyyU8nZFfv8U5eP

Best Answer

bb is really only intended for correcting EPS files with incorrect bounding boxes (or PS files that you want to treat as EPS by supplying a missing bounding box)

If you want to trim an existing figure use the viewport, trim or clip options (which just differ in the way in which the coordinates of the region are specified)