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}


1 Answer 1


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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy