set_tick_locator
Axis.set_major_locator(locator)
- Set the locator of the major ticker.
tick을 표시할 내용의 종류나 방법(단위 설정 등)을 설정
사용법
ax.xaxis.set_major_locator(MultipleLocator(5))
ax.yaxis.set_minor_locator(MultipleLocator(5))
tick_locator 종류
set_tick
Axis.set_ticks(ticks, *, minor=False)
- Set this Axis' tick locations.
If necessary, the view limits of the Axis are expanded so that all given ticks are visible.
--> tick에 표시할 실제 수치(위치)를 설정
- Parameters
- ticks: list of floats
List of tick locations.
--> tick의 위치 설정
- minor: bool, default: False
If False, set the major ticks; if True, the minor ticks.
--> major/minor tick 설정
- set_ticklabels으로 각 tick의 label도 설정 가능
사용법
ax.set_yticks([])
ax.set_xticks(np.arange(len(math_grade)))
ax.set_xticklabels(math_grade.index)