ghiffaryr / grplot

BSD 3-Clause "New" or "Revised" License
32 stars 2 forks source link

@ghiffaryr ini gimana cara biar set_rotationnya ngasih error? #7

Closed ghiffaryr closed 2 years ago

ghiffaryr commented 2 years ago

@ghiffaryr ini gimana cara biar set_rotationnya ngasih error?

def rot_def(ax, axis, rot):
    if axis == 'x':
        try:
            for label in ax.get_xticklabels():
                label.set_rotation(rot)
        except:
            raise Exception('Unknown rot argument!')
    elif axis == 'y':
        try:
            for label in ax.get_yticklabels():
                label.set_rotation(rot)
        except:
            raise Exception('Unknown rot argument!')
    else:
        raise Exception('Unsupported axis!')
    return ax

Originally posted by @renardelyon in https://github.com/ghiffaryr/grplot/issues/4#issuecomment-1130186598

gua taunya itu bisa angka doang sih. mungkin selain itu bakalan error. belum nemu dokumentasi matplotlibnya.

renardelyon commented 2 years ago

@ghiffaryr gw nyoba array kosong gk ngasih error, ngasi error klo manggil method get_rotation