I have two TikZ pictures and I want to set them beside each other such that each one has its own caption. I attempted to use \hfil but it created a big gap between them. Also, my thesis set up to have 4cm (left margin), so it is a bit challenging to set them together with a suitable size though I used \resizebox. Can any help me to fix it?
\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{xdxdff}{rgb}{0.49019607843137253,0.49019607843137253,1.}
\definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1.}
\definecolor{zzttqq}{rgb}{0.6,0.2,0.}\definecolor{zzttqq}{rgb}{0.6,0.2,0.}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-4.3,-7.36) rectangle (20.1,6.3);
\fill[line width=0.8pt,color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (0.,5.) -- (1.24,5.) -- (1.2201234230270745,0.19579267785163076) -- (0.,0.2) -- cycle;
\fill[line width=0.8pt,color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (4.64,5.) -- (5.8,5.) -- (5.8,0.18) -- (4.64015172233386,0.1839994768195382) -- cycle;
\draw [line width=0.8pt] (0.,5.)-- (5.8,5.);
\draw [line width=0.8pt] (0.,4.)-- (5.8,4.);
\draw [line width=0.8pt] (0.,0.2)-- (5.8,0.18);
\draw (0.2,0.3) node[anchor=north west] {$\footnotesize L_{f}$};
\draw (4.7,0.26) node[anchor=north west] {$\footnotesize L_{a}=L_{e}$};
\draw [line width=0.8pt] (4.64,5.)-- (4.64015172233386,0.1839994768195382);
\draw [line width=0.8pt] (5.8,1.18)-- (0.,1.16);
\draw [line width=0.8pt] (1.24,5.)-- (1.2201234230270745,0.19579267785163076);
\draw [line width=0.8pt] (0.,5.)-- (0.,0.2);
\draw [line width=0.8pt] (5.8,5.)-- (5.8,0.18);
\draw (0.62,4.76) node[anchor=north west] {$\footnotesize h$};
\draw (4.7,4.76) node[anchor=north west] {$\footnotesize ha$};
\draw (2.4,5.16) node[anchor=north west] {$\footnotesize \psi_{a}\vert_{_{_{H_{f}}}} $};
\draw [line width=1.2pt] (1.04,4.3)-- (4.42,4.28);
\draw [line width=1.2pt] (5.5,4.2)-- (5.5,1.38);
\draw (4.68,3.34) node[anchor=north west] {$\footnotesize \phi_{a^{*}}\vert_{_{_{H_{a}}}} $};
\draw (2.3,2.84) node[anchor=north west] {$\footnotesize \Psi $};
\draw (4.74,1.28) node[anchor=north west] {$\footnotesize a^{*}ha$};
\draw (0.06,5.18) node[anchor=north west] {$\footnotesize H_{f}$};
\draw (5.32,5.18) node[anchor=north west] {$\footnotesize H_{a}$};
\draw (5.26,0.86) node[anchor=north west] {$\footnotesize H_{e}$};
\draw (-0.72,1.08) node[anchor=north west] {$\footnotesize R_{e}$};
\draw [line width=0.8pt,dash pattern=on 5pt off 5pt] (1.42,3.78)-- (4.42,1.36);
\begin{scriptsize}
\draw [fill=black,shift={(4.42,4.28)},rotate=270] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\draw [fill=black,shift={(5.5,1.38)},rotate=180] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\draw [fill=ududff] (1.04,4.3) circle (1.0pt);
\draw [fill=ududff] (5.5,4.2) circle (1.0pt);
\draw [fill=black,shift={(4.42,1.36)}] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\draw [fill=xdxdff] (-5.8,5.) circle (2.5pt);
\draw[color=xdxdff] (-4.18,6.47) node {$G'$};
\end{scriptsize}
\end{tikzpicture}
\hfil
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-4.3,-7.36) rectangle (20.1,6.3);
\fill[line width=2.pt,color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (0.,5.) -- (5.8,5.) -- (5.8,4.) -- (0.,4.) -- cycle;
\fill[line width=2.pt,color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (0.,1.16) -- (5.8,1.18) -- (5.8,0.18) -- (0.,0.2) -- cycle;
\draw [line width=0.8pt] (0.,5.)-- (5.8,5.);
\draw [line width=0.8pt] (0.,4.)-- (5.8,4.);
\draw [line width=0.8pt] (0.,0.2)-- (5.8,0.18);
\draw (-0.66,5.02) node[anchor=north west] {$\footnotesize R_{f}$};
\draw (4.7,0.26) node[anchor=north west] {$\footnotesize L_{a}=L_{e}$};
\draw [line width=0.8pt] (4.64,5.)-- (4.64015172233386,0.1839994768195382);
\draw [line width=0.8pt] (5.8,1.18)-- (0.,1.16);
\draw [line width=0.8pt] (1.24,5.)-- (1.2201234230270745,0.19579267785163076);
\draw [line width=0.8pt] (0.,5.)-- (0.,0.2);
\draw [line width=0.8pt] (5.8,5.)-- (5.8,0.18);
\draw (2.2,2.76) node[anchor=north west] {$\footnotesize \Psi^{-1} $};
\draw (0.06,5.18) node[anchor=north west] {$\footnotesize H_{f}$};
\draw [line width=1.2pt,dash pattern=on 5pt off 5pt] (4.74,0.44)-- (1.42,0.44);
\draw [line width=0.8pt,dash pattern=on 5pt off 5pt] (0.18,0.66)-- (0.2,3.8);
\draw (2.66,1.3) node[anchor=north west] {$\footnotesize \psi_{a^{*}}\vert_{_{_{H_{e}}}} $};
\draw (5.32,1.32) node[anchor=north west] {$\footnotesize H_{e}$};
\draw (0.38,3.32) node[anchor=north west] {$\footnotesize \phi_{a}\vert_{_{_{H_{a^{*}}}}} $};
\draw (-0.72,1.08) node[anchor=north west] {$\footnotesize R_{a^{*}}$};
\draw (4.86,0.96) node[anchor=north west] {$\footnotesize g$};
\draw [line width=0.8pt,dash pattern=on 5pt off 5pt] (1.42,3.78)-- (4.42,1.36);
\draw (0.4,0.94) node[anchor=north west] {$\footnotesize ga^{*}$};
\draw (0.28,4.72) node[anchor=north west] {$\footnotesize aga^{*}$};
\draw (0.62,1.38) node[anchor=north west] {$\footnotesize H_{a^{*}}$};
\begin{scriptsize}
\draw [fill=black] (4.74,0.44) circle (1.0pt);
\draw [fill=black,shift={(1.42,0.44)},rotate=90] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\draw [fill=black] (0.18,0.66) circle (1.0pt);
\draw [fill=black,shift={(0.2,3.8)}] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\draw [fill=black,shift={(1.42,3.78)},rotate=180] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\end{scriptsize}
\end{tikzpicture}