# Setting margins below and above figures does not have any effect in beamer

For the sake of using captions I'd like to put my graphics into a \begin{figure} ... environment. Doing that a white space is added before and after the picture, table or whatever.

This answer is actually quite clear on how to avoid this.

But setting all lengths affecting float separation to zero has no effect:

\setlength{\textfloatsep}{0pt plus 0pt minus 0pt}
\setlength{\floatsep}{0pt plus 0pt minus 0pt}
\setlength{\intextsep}{0pt plus 0pt minus 0pt}


How can I insert a picture in using

\begin{figure}
\includegraphics ...
...


without any margins?

MWE:

\documentclass{beamer}

\beamersetrightmargin{0.1\paperwidth}
\beamersetleftmargin{0.1\paperwidth}

\setlength{\textfloatsep}{0pt plus 0pt minus 0pt}
\setlength{\floatsep}{0pt plus 0pt minus 0pt}
\setlength{\intextsep}{0pt plus 0pt minus 0pt}

\begin{document}

\begin{columns}

\column{.5\textwidth}
Some text.
\begin{figure}
\framebox[\textwidth][c]{\strut figure one}
\end{figure}
Some text.

\column{.5\textwidth}
Some text.
\framebox[\textwidth][c]{\strut figure two}
Some text.
\end{columns}

\end{document}


In beamer figure is not a float. Its definition is

\newenvironment{figure}[1][]{%
\def\@captype{figure}%
\par\nobreak\begin{center}\nobreak}
{\par\nobreak\end{center}}


and the space you get is inserted by the center environment. You can redefine the environment:

\makeatletter
\renewenvironment{figure}[1][]{%
\def\@captype{figure}%
\par\centering}
{\par}
\makeatother