You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.1.1.post1120+g407a460
matplotlib
Fork me on GitHub

Related Topics

This Page

Coords ReportΒΆ

Override the default reporting of coords.

../../_images/sphx_glr_coords_report_001.png
import matplotlib.pyplot as plt
import numpy as np


def millions(x):
    return '$%1.1fM' % (x*1e-6)


# Fixing random state for reproducibility
np.random.seed(19680801)

x = np.random.rand(20)
y = 1e7*np.random.rand(20)

fig, ax = plt.subplots()
ax.fmt_ydata = millions
plt.plot(x, y, 'o')

plt.show()

Gallery generated by Sphinx-Gallery