2

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:

[\documentclass\[
12pt,
a4paper,
twoside,
debug,
\]{scrbook}                                                 

\usepackage\[ngerman\]{babel}                   
\usepackage\[inner=3.5cm,outer=2.5cm\]{geometry}    

\usepackage{graphicx,import} 
\usepackage\[bf,small,center\]{caption}                

\usepackage\[abs\]{overpic}
\setlength\unitlength{1mm}

\begin{document}


\begin{figure}\[!h\]
    \centering
    \begin{overpic}\[scale=0.4,grid,tics=5\]{testpic}
        \put(50,-5){some text here}
    \end{overpic}
    \caption{caption here}
\end{figure}



\end{document}][1]

1 Answer 1

2

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>
0

Your Answer

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