def _set_integer_tick_labels(axis, labels):
"""Use labels dict to set labels on axis"""
axis.set_major_formatter(FuncFormatter(lambda x, _: labels.get(x, '')))
axis.set_major_locator(MaxNLocator(integer=True))
文章目录