Sophie

Sophie

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

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

.. _pylab_examples-scatter_star_poly:

pylab_examples example code: scatter_star_poly.py
=================================================



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

::

    import numpy as np
    import matplotlib.pyplot as plt
    
    
    x = np.random.rand(10)
    y = np.random.rand(10)
    z = np.sqrt(x**2 + y**2)
    
    plt.subplot(321)
    plt.scatter(x,y,s=80, c=z, marker=">")
    
    plt.subplot(322)
    plt.scatter(x,y,s=80, c=z, marker=(5,0))
    
    verts = zip([-1.,1.,1.,-1.],[-1.,-1.,1.,-1.])
    plt.subplot(323)
    plt.scatter(x,y,s=80, c=z, marker=(verts,0))
    # equivalent:
    #plt.scatter(x,y,s=80, c=z, marker=None, verts=verts)
    
    plt.subplot(324)
    plt.scatter(x,y,s=80, c=z, marker=(5,1))
    
    plt.subplot(325)
    plt.scatter(x,y,s=80, c=z, marker='+')
    
    plt.subplot(326)
    plt.scatter(x,y,s=80, c=z, marker=(5,2))
    
    plt.show()
    

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