def define_labels(reciprocal_space, is_orthogonal, sum_frames, labels=None):
    """
    Define default labels for plots.

    :param reciprocal_space: True if the data is in reciprocal space, False otherwise
    :param is_orthogonal: True is the frame is orthogonal, False otherwise
     (detector frame)
    :param sum_frames: True if the the data is summed along some axis
    :param labels: tuple of two strings (vertical label, horizontal label)
    :return: three tuples of three elements: slice_names, vertical labels,
     horizontal labels. The first element in the tuple corresponds to the first
     subplot and so on.
    """
    labels = labels or ("",) * 2

    if reciprocal_space:
        if is_orthogonal:
            if sum_frames:
                slice_names = (
                    " sum along Q$_x$",
                    " sum along Q$_z$",
                    " sum along Q$_y$",
                )
            else:
                slice_names = (" slice in Q$_x$", " slice in Q$_z$", " slice in Q$_y$")
            ver_labels = (
                labels[0] + r" Q$_z$",
                labels[0] + r" Q$_x$",
                labels[0] + r" Q$_x$",
            )
            hor_labels = (
                labels[1] + r" Q$_y$",
                labels[1] + r" Q$_y$",
                labels[1] + r" Q$_z$",
            )
        else:  # detector frame
            if sum_frames:
                slice_names = (" sum along Z", " sum along Y", " sum along X")
            else:
                slice_names = (" slice in Z", " slice in Y", " slice in X")
            ver_labels = (
                labels[0] + " Y",
                labels[0] + " rocking angle",
                labels[0] + " rocking angle",
            )
            hor_labels = (labels[1] + " X", labels[1] + " X", labels[1] + " Y")
    else:
        if is_orthogonal:
            if sum_frames:
                slice_names = (" sum along z", " sum along y", " sum along x")
            else:
                slice_names = (" slice in z", " slice in y", " slice in x")
            ver_labels = (labels[0] + " y", labels[0] + " z", labels[0] + " z")
            hor_labels = (labels[1] + " x", labels[1] + " x", labels[1] + " y")
        else:  # detector frame
            if sum_frames:
                slice_names = (" sum along Z", " sum along Y", " sum along X")
            else:
                slice_names = (" slice in Z", " slice in Y", " slice in X")
            ver_labels = (
                labels[0] + " Y",
                labels[0] + " rocking angle",
                labels[0] + " rocking angle",
            )
            hor_labels = (labels[1] + " X", labels[1] + " X", labels[1] + " Y")

    return slice_names, ver_labels, hor_labels