坐标报告覆盖coords的默认报告。 12345678910111213141516171819import matplotlib.pyplot as pltimport numpy as npdef millions(x): return '$%1.1fM' % (x*1e-6)# Fixing random state for reproducibilitynp.random.seed(19680801)x = np.random.rand(20)y = 1e7*np.random.rand(20)fig, ax = plt.subplots()ax.fmt_ydata = millionsplt.plot(x, y, 'o')plt.show() 下载这个示例 下载python源码: coords_report.py 下载Jupyter notebook: coords_report.ipynb