title: Caption for figure into a table
body: <p>I've been trying all day to put captions to some figures I arranged into a table. First I used <code>table</code> but it was not succesful, and then I found this post <a href="https://tex.stackexchange.com/questions/383254/placing-figures-inside-table-with-captions-for-each">https://tex.stackexchange.com/questions/383254/placing-figures-inside-table-with-captions-for-each</a>, where <code>tabularx</code> was used. I got good results with figures into the table, but I failed when I try to add captions using <code>\captionof</code>. Here's my code</p>
  <pre><code>\documentclass[aip,amsmath,amssymb,reprint]{revtex4-1}
  
  \usepackage{graphicx}
  \usepackage{dcolumn}
  \usepackage{bm}
  \usepackage[utf8]{inputenc}
  \usepackage[english]{babel}
  \usepackage[T1]{fontenc}
  \usepackage{mathptmx}
  \usepackage{float}
  \usepackage{xcolor}
  \usepackage{multirow}
  \usepackage{float}
  \usepackage{tabularx}
  \usepackage{capt-of}
  \usepackage{tabu}
  
  \begin{document}
  
  \begin{table}
  
  \begin{tabularx}{500pt}{ccc}
  \includegraphics[width=0.48\textwidth]{16b_red_cabezas_normalizadas.png} %\captionof{figure}        
  %{\label{fig:red_all} Functional networks for frequency bands. (a) $\theta$, (b) $\alpha$, (c)                        
  %$\beta$, (d) $\gamma$. Node sizes are proportional to $\langle c_w \rangle$.}
  &amp;\hspace{0.5cm}
  &amp;\includegraphics[width=0.45\textwidth]{2_biplot_alpha.png} %\caption{\label{fig:biplot} Factorial 
  %plane for dynamics and structure. Frontal lobe (orange), occipital (green), parietal (cyan), temporal 
  %(purple).}
  \end{tabularx}
  \end{table}
  
  \end{document}
  </code></pre>
  <p>This code works perfectly, but when I delete <code>%</code> from the code I get some errors like this:</p>
  <pre><code>! Missing \endgroup inserted.&lt;inserted text&gt;\endgroup \end{tabularx}
  ! Missing \cr inserted.&lt;inserted text&gt;\cr \end{tabularx}
  ! Missing } inserted.&lt;inserted text&gt;} \end{tabularx}
  </code></pre>
  <p>I don't know what I am doing wrong. Thanks for your help.</p>