We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates


Previous topic

pylab_examples example code: coords_demo.py

Next topic

pylab_examples example code: csd_demo.py

This Page

pylab_examples example code: coords_report.pyΒΆ

(Source code, png, hires.png, pdf)

#!/usr/bin/env python

# override the default reporting of coords

import matplotlib.pyplot as plt
import numpy as np

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

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

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


Keywords: python, matplotlib, pylab, example, codex (see Search examples)