I am using the following code to get two figures side by side. The code (MWE) is:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{adjustbox}
\usepackage{float}
\begin{document}
\begin{figure}
\begin{minipage}[b]{0.49\textwidth}
\begin{figure}[H]
\begin{adjustbox}{width=1\textwidth}{
\begin{tikzpicture}[my plot/.style={thick, smooth, samples=100, domain=0.1:5}, my grid/.style={densely dotted,opacity=0.5, every node/.style={black,opacity=1}}, my axis/.style={latex-latex}]
\draw[my plot, color=black] (0,0) plot (\x,{ln(\x)});
\coordinate (start plot) at (0.1,{ln(0.1)});
\coordinate (end plot) at (5,{ln(5)});
\draw[my axis] ([shift={(-0.5cm,0.5cm)}]start plot |- end plot) node[above] {$u(\cdot)$} |- node[coordinate](origin){} ([shift={(0.5cm,-0.5cm)}]start plot -| end plot) node[right] {$\cdot$};
\def\x{0.5}\def\y{4}\def\p{0.55}
\coordinate (Ux) at (\x,{ln(\x)});
\coordinate (Uy) at (\y,{ln(\y)});
\coordinate (Up) at ({\p*\x+(1-\p)*\y},{ln(\p*\x+(1-\p)*\y)});
\draw (Ux) -- coordinate[pos=1-\p] (Up-mid) (Uy);
\path let \p1=(Up-mid), \n1={pow(e,\y1*0.03514)} in (28.4576*\n1,\y1) coordinate (Up-mid2);
\draw[my grid] (Ux) |- node[below,font=\scriptsize]{$x$} (origin) |- node[left,font=\scriptsize]{$u(x)$} cycle;
\draw[my grid] (Uy) |- node[below,font=\scriptsize]{$y$} (origin) |- node[left,font=\scriptsize]{$u(y)$} cycle;
\draw[my grid] (Up) |- node[below, yshift=2.25pt, font=\scriptsize]{$px+(1-p)y$} (origin) |- node[left,font=\scriptsize]{$u(px+(1-p)y)$} cycle;
\draw[my grid] (Up-mid) |- (origin) |- node[left,font=\scriptsize]{$pu(x)+(1-p)u(y)$} cycle;
\draw[my grid] (Up-mid) -- (Up-mid2);
\end{tikzpicture}}
\end{adjustbox}
\caption{Risk Aversion}\label{RA}
\end{figure}
\end{minipage}
\hfill
\begin{minipage}[b]{0.49\textwidth}
\begin{figure}[H]
\begin{adjustbox}{width=1\textwidth}{
\begin{tikzpicture}[my plot/.style={thick, smooth, samples=100, domain=0.1:5.5}, my grid/.style={densely dotted,opacity=0.5, every node/.style={black,opacity=1}}, my axis/.style={latex-latex}]
\draw[my plot, color=black] (0,0) plot (\x,{(\x)});
\coordinate (start plot) at (0,{(0)});
\coordinate (end plot) at (5.5,{(5.5)});
\draw[my axis] ([shift={(-0.5cm,0.5cm)}]start plot |- end plot) node[above] {$u(\cdot)$} |- node[coordinate](origin){} ([shift={(0.5cm,-0.5cm)}]start plot -| end plot) node[right] {$\cdot$};
\def\x{0.5}\def\y{4}\def\p{0.55}
\coordinate (Ux) at (\x,{(\x)});
\coordinate (Uy) at (\y,{(\y)});
\coordinate (Up) at ({\p*\x+(1-\p)*\y},{(\p*\x+(1-\p)*\y)});
\draw (Ux) -- coordinate[pos=1-\p] (Up-mid) (Uy);
\path let \p1=(Up-mid), \n1={pow(e,\y1*0.03514)} in (28.4576*\n1,\y1) coordinate (Up-mid2);
\draw[my grid] (Ux) |- node[below,font=\scriptsize]{$x$} (origin) |- node[left,font=\scriptsize]{$u(x)$} cycle;
\draw[my grid] (Uy) |- node[below,font=\scriptsize]{$y$} (origin) |- node[left,font=\scriptsize]{$u(y)$} cycle;
\draw[my grid] (Up) |- node[below, yshift=2.25pt, font=\scriptsize]{$px+(1-p)y$} (origin) |- node[align=right,font=\scriptsize,xshift=-40pt]{$pu(x)+(1-p)u(y)=$\\$=u(px+(1-p)y)$} cycle;
\end{tikzpicture}}
\end{adjustbox}
\caption{Risk Neutrality}\label{RN}
\end{figure}
\end{minipage}
\end{figure}
\end{document}
The result is this one:
Though the result does not look bad, I would like the plots to be the exact same size; that is, the same length of the axes, same font size, and so on. However, with my code I get that the plot in the right-hand side is slightly larger that the one in the left. I want to avoid that. Does anybody know how to achieve that? I am afraid I may need to adjust the axes of the figures, but whatever I try, I deliberately fail. Thank you all for your help



scale=0.5in the first figure and multiply the scaling factors of the second one also by 0.5, they will only take half the space. – gernot Dec 03 '16 at 14:44\llapcommand may be useful to handle the long labels. – gernot Dec 03 '16 at 15:27