Sophie

Sophie

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

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

.. _api-watermark_text:

api example code: watermark_text.py
===================================



.. plot:: /home/mandrake/rpm/BUILD/matplotlib-1.1.1/doc/mpl_examples/api/watermark_text.py

::

    """
    Use a Text as a watermark
    """
    import numpy as np
    #import matplotlib
    #matplotlib.use('Agg')
    
    import matplotlib.pyplot as plt
    
    fig = plt.figure()
    
    ax = fig.add_subplot(111)
    ax.plot(np.random.rand(20), '-o', ms=20, lw=2, alpha=0.7, mfc='orange')
    ax.grid()
    
    # position bottom right
    fig.text(0.95, 0.05, 'Property of MPL',
             fontsize=50, color='gray',
             ha='right', va='bottom', alpha=0.5)
    
    plt.show()
    

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