I am trying to put a figure beside a table using a minipage. Below is my table.
\documentclass[twocolumn]{book}
\usepackage {lipsum}
\usepackage {showframe} % just for this example
\usepackage {subfig}
\usepackage {tikz}
\usepackage{booktabs, array}
\newcolumntype{x}[1]{>{\centering\arraybackslash\hspace{0pt}}p{#1}}
\begin{document}
\begin{table}
\setlength{\tabcolsep}{4pt}
\scriptsize
\centering
\caption{XX.}
\begin{tabular}{l|x{.3in}x{.3in}|x{.3in}x{.3in}|x{.3in}x{.3in}}
\toprule
& \multicolumn{2}{c|}{XX} & \multicolumn{2}{c|}{XX} & \multicolumn{2}{c}{XX} \
\textbf{Recognition} & Left & Right & Left & Right & Left & Right \
\midrule
XX & XX & XX & XX & XX & XX & XX \
XX XX & XX & XX & XX & XX & XX & XX \
XX XX & XX & XX & XX & XX & XX & XX \
\bottomrule
\multicolumn{6}{c}{\textcolor{white}{1}} \
\toprule
& \multicolumn{2}{c|}{XX} & \multicolumn{2}{c|}{XX} & \multicolumn{2}{c}{XX} \
\textbf{Anticipation} & Left & Right & Left & Right & Left & Right \
\midrule
XX & XX & XX & XX & XX & XX & XX \
XX XX & XX & XX & XX & XX & XX & XX \
XX XX & XX & XX & XX & XX & XX & XX \
\bottomrule
\end{tabular}
\end{table}
\end{document}
The code with the minipage does not work. The table goes missing.
\documentclass[twocolumn]{book}
\usepackage {lipsum}
\usepackage {showframe} % just for this example
\usepackage {subfig}
\usepackage {tikz}
\usepackage{booktabs, array}
\newcolumntype{x}[1]{>{\centering\arraybackslash\hspace{0pt}}p{#1}}
\begin{document}
\begin{minipage}{0.6\textwidth}
\begin{table}
\setlength{\tabcolsep}{4pt}
\scriptsize
\centering
\caption{XX.}
\begin{tabular}{l|x{.3in}x{.3in}|x{.3in}x{.3in}|x{.3in}x{.3in}}
\toprule
& \multicolumn{2}{c|}{XX} & \multicolumn{2}{c|}{XX} & \multicolumn{2}{c}{XX} \
\textbf{Recognition} & Left & Right & Left & Right & Left & Right \
\midrule
XX & XX & XX & XX & XX & XX & XX \
XX XX & XX & XX & XX & XX & XX & XX \
XX XX & XX & XX & XX & XX & XX & XX \
\bottomrule
\multicolumn{6}{c}{\textcolor{white}{1}} \
\toprule
& \multicolumn{2}{c|}{XX} & \multicolumn{2}{c|}{XX} & \multicolumn{2}{c}{XX} \
\textbf{Anticipation} & Left & Right & Left & Right & Left & Right \
\midrule
XX & XX & XX & XX & XX & XX & XX \
XX XX & XX & XX & XX & XX & XX & XX \
XX XX & XX & XX & XX & XX & XX & XX \
\bottomrule
\end{tabular}
\end{table}
\end{minipage}
\begin{minipage}{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
\caption{caption below}
\end{minipage}
\end{document}

