def limitaxis(c,maxc,minc=0):
    """
    Limit value in axis.

    :param c: value
    :param maxc: max c value.
    :param minc: min c value.
    :return: limited c value c E [minc,maxc]
    """
    if c > maxc:
        c = maxc
    if c < minc:
        c = minc
    return c