I have the following code that produce a 3×3 grid with an arrow in it. Some of the grid cells have a # in them.
\begin{picture}(185,90)
\put(0,0){\framebox(30,30)}
\put(30,0){\framebox(30,30)}
\put(60,0){\framebox(30,30)}
\put(0,30){\framebox(30,30)}
\put(30,30){\framebox(30,30)}
\put(60,30){\framebox(30,30){\Large{\#}}}
\put(0,60){\framebox(30,30){\Large{\#}}}
\put(30,60){\framebox(30,30){\Large{\#}}}
\put(60,60){\framebox(30,30){\Large{\#}}}
\put(15,45){\vector(1,0){30}}
\end{picture}
I would like to put a caption under the drawn picture. How could I achieve this? I believe that you can't put a caption inside a \begin{picture}. I have also try to wrap it inside a \begin{figure} without success.
Best Answer
Put the
picture
inside aminipage
. This will allow it to be included in afigure
environment, which will therefore allow a\caption
.Following up on the OP's comment, one can, in order to get multiple images on a single line, place adjacent
minipage
s on the same line, as long as they don't exceed the\linewidth
.