def get_axes_dimension(axes):
    """Returns the number of dimensions of a matplotlib axes object.

        Parameters
        ----------
        axes : object
            The matplotlib axes object.

        Returns
        -------
        int
            The number of dimensions of a matplotlib axes object.
        """
    if hasattr(axes, 'get_zlim'):
        return 3
    else:
        return 2