The code below by Simon Dispa in my previous post creates a very nice table and image staying together. However, it is not float. I'm looking for something like this but float.
If I just use two separate floats table and figure then there is still a chance for them to be splitted. Therefore, I'm looking for something like one float.
\documentclass[journal]{IEEEtran}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{tabularray}
\usepackage{booktabs,capt-of}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\noindent\begin{minipage}{\linewidth}
\begin{minipage}[b]{\linewidth}
\centering
\includegraphics[width=\linewidth]{example-image-a}
\label{fig:a figure}
\captionof{figure}{a figure}
\end{minipage}
\hfill
\begin{minipage}[b]{\linewidth}
\captionof{table}{a table}
\label{tab:a table}
\footnotesize %<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,
\begin{tblr}{
colspec={Q[2.35em,c] *7{Q[2.34em,c]}},
vline{1} = {2-Z}{0.8pt},
vline{2,Z} = {0.8pt},
vline{3-Y} = {0.3pt},
hline{1} = {2-Z}{0.8pt},
hline{2,Z} = {0.8pt},
hline{3-Y} = {0.3pt},
row{1-8} = {mode=math},
column{1-8} = {mode=math},
}
& V_1 & V_2 & V_3 & V_4 & V_5 & V_6 & V_7\\
V_1 & & 1 & 0 & 0 & 1 & 0 & 1\\
V_2 & 1 & 0 & 1 & 0 & 1 & 0 & 1\\
V_3 & 0 & 1 & 0 & 1 & 0 & 0 & 1\\
V_4 & 0 & 0 & 1 & 0 & 1 & 0 & 1\\
V_5 & 1 & 1 & 0 & 1 & 0 & 0 & 1\\
\end{tblr}
\end{minipage}
\vspace*{\baselineskip} %<<<<<<<<<<<<<<<
\end{minipage}
\lipsum[1]
\end{document}