Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > bf21b4394f4d7fa09e3626145d3315e0 > files > 361

python-matplotlib-doc-1.2.0-14.fc18.i686.rpm

.. _pylab_examples-figimage_demo:

pylab_examples example code: figimage_demo.py
=============================================



.. plot:: /builddir/build/BUILD/matplotlib-1.2.0/doc/mpl_examples/pylab_examples/figimage_demo.py

::

    """
    This illustrates placing images directly in the figure, with no axes.
    
    """
    import numpy as np
    import matplotlib
    import matplotlib.cm as cm
    import matplotlib.pyplot as plt
    
    
    fig = plt.figure()
    Z = np.arange(10000.0)
    Z.shape = 100,100
    Z[:,50:] = 1.
    
    im1 = plt.figimage(Z, xo=50, yo=0, cmap=cm.jet, origin='lower')
    im2 = plt.figimage(Z, xo=100, yo=100, alpha=.8, cmap=cm.jet, origin='lower')
    
    plt.show()
    
    
    
    

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