I'm trying to draw a cube similar to the one in the pic, but I don't get the desired result.
\documentclass[letterpaper, 12pt]{article}
\usepackage[margin = 1in]{geometry}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{xcolor}
\begin{document}
\begin{tikzpicture}
\draw[dashed] (2,0,0) -- (2,2,0) node[midway,right] {$L$};
\draw [dashed] (0,2,2) -- (0,0,2);
\draw[dashed] (0,0,0) -- (0,2,0);
\draw [dashed] (2,0,2) -- (2,2,2);
\draw[very thick] (0,2,0) -- (0,2,2) -- (2,2,2) -- (2,2,0) -- cycle;
\filldraw[color=gray!40] (0,2,0) -- (0,2,2) -- (2,2,2) -- (2,2,0) -- cycle;
\draw[very thick] (0,0,0) -- (0,0,2) -- (2,0,2) -- (2,0,0) -- cycle;
\filldraw[color=gray!40] (0,0,0) -- (0,0,2) -- (2,0,2) -- (2,0,0) -- cycle;
\end{tikzpicture}
\end{document}