Sophie

Sophie

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

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

.. _axes_grid-demo_axisline_style:

axes_grid example code: demo_axisline_style.py
==============================================



.. plot:: /builddir/build/BUILD/matplotlib-1.2.0/doc/mpl_examples/axes_grid/demo_axisline_style.py

::

    
    from mpl_toolkits.axes_grid.axislines import SubplotZero
    import matplotlib.pyplot as plt
    import numpy as np
    
    if 1:
        fig = plt.figure(1)
        ax = SubplotZero(fig, 111)
        fig.add_subplot(ax)
    
        for direction in ["xzero", "yzero"]:
            ax.axis[direction].set_axisline_style("-|>")
            ax.axis[direction].set_visible(True)
    
        for direction in ["left", "right", "bottom", "top"]:
            ax.axis[direction].set_visible(False)
    
        x = np.linspace(-0.5, 1., 100)
        ax.plot(x, np.sin(x*np.pi))
    
        plt.show()
    

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