def _imshow_formater(arr):
    """Creates a formating function to show the values of imshow in the status
    bar.

    :param arr: Array to be shown
    :returns: function formater(x, y) that should be set to ax.format_coord

    """
    def format_coord(x, y):
        col, row = int(x + .5), int(y + .5)
        if (col >= 0) and (col < arr.shape[1]) \
                and (row >= 0) and (row < arr.shape[0]):
            return "x={}, y={}, val={}".format(col, row, arr[row, col])
        else:
            return "x={}, y={}".format(col, row)
    return format_coord