In [10]:
from matplotlib import pyplot as plt
from mpl_toolkits import axisartist
import numpy as np

In [11]:
np.random.seed(12345678)
x1 = np.random.normal(0.5,0.5,20)
y1 = x1 + np.random.normal(0.5,0.2,20)
x2 = np.random.normal(1.5,0.5,20)
y2 = x2 - np.random.normal(0.5,0.2,20)
lx = np.linspace(-0.5,2.5,20)   
ly1 = lx * 1.2 - 0.2
ly2 = lx * 0.9 + 0.2
ly3 = lx

In [33]:
plt.scatter(x1,y1, marker="+")
plt.scatter(x2,y2,marker="_")
plt.plot(lx,ly1)
plt.plot(lx,ly2)
plt.plot(lx,ly3)

ax = plt.gca().axes
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)

plt.show()



In [18]:
axis = ax.axis['left']

In [28]:
fig.axes()


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-28-92bf73771278> in <module>()
----> 1 fig.axes()

TypeError: 'list' object is not callable

In [35]:
help(plt.axis)


Help on function axis in module matplotlib.pyplot:

axis(*v, **kwargs)
    Convenience method to get or set axis properties.
    
    Calling with no arguments::
    
      >>> axis()
    
    returns the current axes limits ``[xmin, xmax, ymin, ymax]``.::
    
      >>> axis(v)
    
    sets the min and max of the x and y axes, with
    ``v = [xmin, xmax, ymin, ymax]``.::
    
      >>> axis('off')
    
    turns off the axis lines and labels.::
    
      >>> axis('equal')
    
    changes limits of *x* or *y* axis so that equal increments of *x*
    and *y* have the same length; a circle is circular.::
    
      >>> axis('scaled')
    
    achieves the same result by changing the dimensions of the plot box instead
    of the axis data limits.::
    
      >>> axis('tight')
    
    changes *x* and *y* axis limits such that all data is shown. If
    all data is already shown, it will move it to the center of the
    figure without modifying (*xmax* - *xmin*) or (*ymax* -
    *ymin*). Note this is slightly different than in MATLAB.::
    
      >>> axis('image')
    
    is 'scaled' with the axis limits equal to the data limits.::
    
      >>> axis('auto')
    
    and::
    
      >>> axis('normal')
    
    are deprecated. They restore default behavior; axis limits are automatically
    scaled to make the data fit comfortably within the plot box.
    
    if ``len(*v)==0``, you can pass in *xmin*, *xmax*, *ymin*, *ymax*
    as kwargs selectively to alter just those limits without changing
    the others.
    
      >>> axis('square')
    
    changes the limit ranges (*xmax*-*xmin*) and (*ymax*-*ymin*) of
    the *x* and *y* axes to be the same, and have the same scaling,
    resulting in a square plot.
    
    The xmin, xmax, ymin, ymax tuple is returned
    
    .. seealso::
    
        :func:`xlim`, :func:`ylim`
           For setting the x- and y-limits individually.


In [34]:
x = [ -1,0,0,1]
y = [1,1,0,0]

plt.plot(x,y)
plt.show()



In [ ]: