I am trying to put a tabularx inside a tcolorbox but it's not centered properly, it's shifted slightly to the right. Here is the code I am using. I am using figure
environment for the caption. Is there a better way to do this?
\documentclass[12pt, a4paper]{article}
\usepackage[top=1in, bottom=1.5in, right=1in, left=1in]{geometry}
\usepackage{tabularx}
\usepackage{tcolorbox}
\usepackage{chemfig}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{document}
\begin{figure}[ht]
\centering
\begin{tcolorbox}
\begin{tabularx}{1\linewidth}{YYYY}
{}\chemfig{C(-[:90,.6]H)(-[:180,.6]H)(-[:270,.6]H) -[,.6]C(-[:90,.6]H)(-[:0,.6]H)(-[:270,.6]H)} &
{}\chemfig{C(-[:135,.6]H)(-[:225,.6]H) =[,.6]C(-[:45,.6]H)(-[:315,.6]H)} &
{}\chemfig{C(-[:135,.6]H)(-[:225,.6]H) =[,.6]C=[,.6]C(-[:45,.6]H)(-[:315,.6]H)} &
{}\chemfig{C(-[:180,.6]H) ~[,.6]C -[,.6]C(-[:90,.6]H)(-[:0,.6]H)(-[:270,.6]H)} \\[5ex]
(a) Ethane & (b) Ethylene & (c) Propadiene & (d) Propyne\\
\end{tabularx}
\end{tcolorbox}
\vspace{-1.5ex}
\caption{caption}
\label{fig:my_label}
\end{figure}
\end{document}