我有一个数字的6把斧头。每个轴上的限制是不同的。在每把斧头上,我发出了命令:
ax.locator_params(axis='x', nbins=9)
ax.locator_params(axis='y', nbins=7)但当我策划这件事时,我得到:

我想得到9个主轴,每个轴的x轴上有9个标签,每个轴的y轴上有7个标签。我怎样才能做到这一点?非常感谢。
发布于 2016-01-21 08:59:34
from matplotlib.ticker import MaxNLocator
import matplotlib.pyplot as plt
fig, (ax1, ax2, ax3, ax4, ax5, ax6) = plt.subplots(nrows=2, ncols=3)
# add plot code here
ax1.xaxis.set_major_locator(MaxNLocator(nbins=9))
ax1.yaxis.set_major_locator(MaxNLocator(nbins=7))
#repeat for other axeshttps://stackoverflow.com/questions/34914523
复制相似问题