Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > a44f8c7e78ee9c5838c1fb080c9e7630 > files > 1270

python-matplotlib-doc-1.1.1-1mdv2010.1.noarch.rpm

.. _pylab_examples-coords_report:

pylab_examples example code: coords_report.py
=============================================



.. plot:: /home/mandrake/rpm/BUILD/matplotlib-1.1.1/doc/mpl_examples/pylab_examples/coords_report.py

::

    #!/usr/bin/env python
    
    # override the default reporting of coords
    
    from pylab import *
    
    def millions(x):
        return '$%1.1fM' % (x*1e-6)
    
    x =     rand(20)
    y =     1e7*rand(20)
    
    ax = subplot(111)
    ax.fmt_ydata = millions
    plot(x, y, 'o')
    
    show()
    
    

Keywords: python, matplotlib, pylab, example, codex (see :ref:`how-to-search-examples`)