1

I would like to put a matrix next to a figure in my text. Currently the display is as can be seen in the image. I prefer the matrix on the left and the tree on the right. enter image description here

I am using this:

\usepackage{amsmath}
\usepackage{graphicx}
\includegraphics[scale=.8]{Graficos/arbolR1.pdf} 
\caption{R-vine from Matrix M. Tree 1.}
\label{fig:R-vine1}

\begin{figure}
\centering
\small
\label{M}
\(
M= 
\begin{pmatrix}
5&&&&&&&&\\
8&1&&&&&&&\\
2&8&2&&&&&&\\
3&2&8&3&&&&&\\
4&3&7&8&4&&&&\\
9&4&9&7&8&8&&&\\
7&9&3&9&7&9&7&&\\
6&7&4&4&9&7&9&6&\\
1&6&6&6&6&6&6&9&9\\
\end{pmatrix}
\)
\caption{Matrix Structure}
\end{figure}

I will appreciate any help!!!!

Wilmer Rojas
  • 157
  • 2
  • 14

1 Answers1

5

Please see the following MWE (I used minipage for this):

\documentclass{article}

\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}

\begin{figure}
\centering
\begin{minipage}[b]{.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
\caption{First caption}\label{first}
\end{minipage}\hfill
\begin{minipage}[b]{.45\textwidth}
%\begin{figure}
\centering
\small
\label{M}
\(
M= 
\begin{pmatrix}
5&&&&&&&&\\
8&1&&&&&&&\\
2&8&2&&&&&&\\
3&2&8&3&&&&&\\
4&3&7&8&4&&&&\\
9&4&9&7&8&8&&&\\
7&9&3&9&7&9&7&&\\
6&7&4&4&9&7&9&6&\\
1&6&6&6&6&6&6&9&9\\
\end{pmatrix}
\)
\caption{Matrix Structure}\label{second}
%\end{figure}
\end{minipage}
\end{figure}

\end{document}

with the result:

resulting pdf

Mensch
  • 65,388
  • +1 for giving more options than existing here (https://tex.stackexchange.com/a/305131/120578). That answer is specific for tabular... So not a duplicate. Commenting just to show more existing solutions. – koleygr Oct 18 '17 at 19:55
  • @WilmerRojas, If your problem is solved please accept the answer. – koleygr Oct 18 '17 at 21:52