[Tex/LaTex] Latex: Adding extra white space to a figure


I want to use overpic to add text below and next to a figure from matlab. When exporting the figure in matlab all white space at the border of the figure is removed so that there is not enough space to add additional text using overpic in latex. How can I solve this?
Here an example code for latex:






        \put(50,-5){some text here}
    \caption{caption here}


Best Answer

There are multiple ways to do this, but probably the easiest one to handle (in my opinion) is trim and clip. Trimming is typically used to reduce figure size, but you can also increase by trimming negative amounts it. The remaining space is normally filled with whitespace.

%This should increase size at bottom and right side by 1cm with whitespace.

\begin{overpic}[scale=0.4, grid, tics=5, trim=0 -1cm -1cm 0, clip]{testpic}

%The trim options are given in <left, lower, right, upper>