ax.ticklabel_format(轴=' z',风格=' sci',scilimits =( - 2,2))
给出错误: AttributeError:此方法仅适用于ScalarFormatter。
答案 0 :(得分:0)
This works for me:
from matplotlib import ticker
formatter = ticker.ScalarFormatter(useMathText=True)
formatter.set_scientific(True)
formatter.set_powerlimits((-2,2))
ax.w_xaxis.set_ticklabels(column_names)
ax.w_yaxis.set_ticklabels(row_names)
ax.w_zaxis.set_major_formatter(formatter)