In [18]:
fix_L = np.array([[10, 10, 100.]])
fix_R = np.array([[7, 12, 100.]])
loc_L = np.array([[-3., 0, 0]])
loc_R = np.array([[3., 0, 0]])

In [2]:
import numpy as np

In [4]:
whos


Variable   Type       Data/Info
-------------------------------
fix_L      ndarray    1x3: 3 elems, type `float64`, 24 bytes
fix_R      ndarray    1x3: 3 elems, type `float64`, 24 bytes
loc_L      ndarray    1x3: 3 elems, type `int64`, 24 bytes
loc_R      ndarray    1x3: 3 elems, type `int64`, 24 bytes
np         module     <module 'numpy' from '/Us<...>ages/numpy/__init__.pyc'>

In [6]:
whos


Variable   Type       Data/Info
-------------------------------
fix_L      ndarray    1x3: 3 elems, type `float64`, 24 bytes
fix_R      ndarray    1x3: 3 elems, type `float64`, 24 bytes
loc_L      ndarray    1x3: 3 elems, type `float64`, 24 bytes
loc_R      ndarray    1x3: 3 elems, type `float64`, 24 bytes
np         module     <module 'numpy' from '/Us<...>ages/numpy/__init__.pyc'>

In [7]:
fix_L = fix_L - loc_L                       # translate fix_L into coordinate system with loc_L at origin
fix_L = fix_L / np.linalg.norm(fix_L)       # make unit length
fix_L = fix_L + loc_L                       # translate back in to cyclopean coordinates

fix_R = fix_R - loc_R                       # translate fix_R into coordinate system with loc_R at origin
fix_R = fix_R / np.linalg.norm(fix_R)       # make unit length
fix_R = fix_R + loc_R                       # translate back in to cyclopean coordinates

In [8]:
fix_L


Out[8]:
array([[-2.871714  ,  0.09868154,  0.98681541]])

In [9]:
fix_R


Out[9]:
array([[ 3.03968379,  0.11905137,  0.99209474]])

In [10]:
y = np.matrix([[loc_L[1,0], fix_L[1,0], loc_R[1,0], fix_R[1,0]]]).T


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-10-dbe14493fe9b> in <module>()
----> 1 y = np.matrix([[loc_L[1,0], fix_L[1,0], loc_R[1,0], fix_R[1,0]]]).T

IndexError: index 1 is out of bounds for axis 0 with size 1

In [11]:
loc_L.shape


Out[11]:
(1, 3)

In [12]:
loc_L[1]


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-12-362563f2b608> in <module>()
----> 1 loc_L[1]

IndexError: index 1 is out of bounds for axis 0 with size 1

In [13]:
tmp = fix_L.squeeze()

In [14]:
tmp.shape


Out[14]:
(3,)

In [15]:
tmp[0]


Out[15]:
-2.8717139966095768

In [17]:
tmp[2]


Out[17]:
0.98681541069556156

In [19]:
whos


Variable   Type       Data/Info
-------------------------------
fix_L      ndarray    1x3: 3 elems, type `float64`, 24 bytes
fix_R      ndarray    1x3: 3 elems, type `float64`, 24 bytes
loc_L      ndarray    1x3: 3 elems, type `float64`, 24 bytes
loc_R      ndarray    1x3: 3 elems, type `float64`, 24 bytes
np         module     <module 'numpy' from '/Us<...>ages/numpy/__init__.pyc'>
tmp        ndarray    3: 3 elems, type `float64`, 24 bytes

In [20]:
fix_L


Out[20]:
array([[  10.,   10.,  100.]])

In [21]:
fix_L = fix_L.squeeze()
fix_R = fix_R.squeeze()
loc_L = loc_L.squeeze()
loc_R = loc_R.squeeze()

In [22]:
whos


Variable   Type       Data/Info
-------------------------------
fix_L      ndarray    3: 3 elems, type `float64`, 24 bytes
fix_R      ndarray    3: 3 elems, type `float64`, 24 bytes
loc_L      ndarray    3: 3 elems, type `float64`, 24 bytes
loc_R      ndarray    3: 3 elems, type `float64`, 24 bytes
np         module     <module 'numpy' from '/Us<...>ages/numpy/__init__.pyc'>
tmp        ndarray    3: 3 elems, type `float64`, 24 bytes

In [23]:
fix_L = fix_L - loc_L                       # translate fix_L into coordinate system with loc_L at origin
fix_L = fix_L / np.linalg.norm(fix_L)       # make unit length
fix_L = fix_L + loc_L                       # translate back in to cyclopean coordinates

fix_R = fix_R - loc_R                       # translate fix_R into coordinate system with loc_R at origin
fix_R = fix_R / np.linalg.norm(fix_R)       # make unit length
fix_R = fix_R + loc_R                       # translate back in to cyclopean coordinates

In [24]:
fix_L


Out[24]:
array([-2.871714  ,  0.09868154,  0.98681541])

In [25]:
fix_R


Out[25]:
array([ 3.03968379,  0.11905137,  0.99209474])

In [26]:
y = np.matrix([[loc_L[1], fix_L[1], loc_R[1], fix_R[1]]]).T # y vector

In [27]:
y


Out[27]:
matrix([[ 0.        ],
        [ 0.09868154],
        [ 0.        ],
        [ 0.11905137]])

In [28]:
Z = np.matrix([[loc_L[2], fix_L[2], loc_R[2], fix_R[2]]]).T # Z vector

In [29]:
Z


Out[29]:
matrix([[ 0.        ],
        [ 0.98681541],
        [ 0.        ],
        [ 0.99209474]])

In [30]:
b = np.linalg.inv(Z.T * Z) * Z.T * y

In [31]:
b


Out[31]:
matrix([[ 0.11005336]])

In [32]:
loc_L_new  = np.array([[loc_L[0], b*loc_L[2], loc_L[2]]]) # project (x and z are the same, y = bz)
loc_R_new  = np.array([[loc_R[0], b*loc_R[2], loc_R[2]]]) # project

In [33]:
loc_L_new


Out[33]:
array([[-3.,  0.,  0.]])

In [34]:
fix_L_new  = np.array([[fix_L[0], b*fix_L[2], fix_L[2]]]) # project (x and z are the same, y = bz)
fix_R_new  = np.array([[fix_R[0], b*fix_R[2], fix_R[2]]]) # project

In [35]:
fix_L_new


Out[35]:
array([[-2.871714  ,  0.10860235,  0.98681541]])

In [36]:
fix_R_new


Out[36]:
array([[ 3.03968379,  0.10918335,  0.99209474]])

In [37]:
P = np.array([[u[0,0], -1, u[0,1]]])    # vector normal to the epipolar plane
    P = P / np.linalg.norm(P)               # normalize


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-37-f922ab140a94> in <module>()
----> 1 P = np.array([[u[0,0], -1, u[0,1]]])    # vector normal to the epipolar plane
      2 P = P / np.linalg.norm(P)               # normalize
      3 

NameError: name 'u' is not defined

In [38]:
P = np.array([0, -1, b])

In [39]:
P


Out[39]:
array([ 0.        , -1.        ,  0.11005336])

In [40]:
P = P / np.linalg.norm(P)

In [41]:
P


Out[41]:
array([ 0.        , -0.99399859,  0.10939288])

In [42]:
th_L = np.degrees(np.arcsin(np.dot( P, (fix_L - loc_L) / np.linalg.norm(fix_L - loc_L))))

In [43]:
th_L


Out[43]:
0.56501815692752988

In [44]:
th_L = np.degrees(np.arcsin(np.dot( P, (fix_L - loc_L) / np.linalg.norm(fix_L - loc_L))))
    th_R = np.degrees(np.arcsin(np.dot( P, (fix_R - loc_R) / np.linalg.norm(fix_R - loc_R))))
    
    th_L_new = np.degrees(np.arcsin(np.dot( P, (fix_L_new - loc_L) / np.linalg.norm(fix_L_new - loc_L))))
    th_R_new = np.degrees(np.arcsin(np.dot( P, (fix_R_new - loc_R) / np.linalg.norm(fix_R_new - loc_R))))


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-44-3eaa6a2b8fa4> in <module>()
      2 th_R = np.degrees(np.arcsin(np.dot( P, (fix_R - loc_R) / np.linalg.norm(fix_R - loc_R))))
      3 
----> 4 th_L_new = np.degrees(np.arcsin(np.dot( P, (fix_L_new - loc_L) / np.linalg.norm(fix_L_new - loc_L))))
      5 th_R_new = np.degrees(np.arcsin(np.dot( P, (fix_R_new - loc_R) / np.linalg.norm(fix_R_new - loc_R))))

ValueError: shapes (3,) and (1,3) not aligned: 3 (dim 0) != 1 (dim 0)

In [45]:
whos


Variable    Type       Data/Info
--------------------------------
P           ndarray    3: 3 elems, type `float64`, 24 bytes
Z           matrix     [[ 0.        ]\n [ 0.9868<...>       ]\n [ 0.99209474]]
b           matrix     [[ 0.11005336]]
fix_L       ndarray    3: 3 elems, type `float64`, 24 bytes
fix_L_new   ndarray    1x3: 3 elems, type `float64`, 24 bytes
fix_R       ndarray    3: 3 elems, type `float64`, 24 bytes
fix_R_new   ndarray    1x3: 3 elems, type `float64`, 24 bytes
loc_L       ndarray    3: 3 elems, type `float64`, 24 bytes
loc_L_new   ndarray    1x3: 3 elems, type `float64`, 24 bytes
loc_R       ndarray    3: 3 elems, type `float64`, 24 bytes
loc_R_new   ndarray    1x3: 3 elems, type `float64`, 24 bytes
np          module     <module 'numpy' from '/Us<...>ages/numpy/__init__.pyc'>
th_L        float64    0.565018156928
th_R        float64    -0.562011376014
tmp         ndarray    3: 3 elems, type `float64`, 24 bytes
y           matrix     [[ 0.        ]\n [ 0.0986<...>       ]\n [ 0.11905137]]

In [48]:
fix_L_new[0,].shape


Out[48]:
(3,)

In [47]:
fix_L


Out[47]:
array([-2.871714  ,  0.09868154,  0.98681541])

In [49]:
fix_L = np.array([[10, 10, 100.]]).T
fix_R = np.array([[7, 12, 100.]]).T
loc_L = np.array([[-3., 0, 0]]).T
loc_R = np.array([[3., 0, 0]]).T

In [50]:
whos


Variable    Type       Data/Info
--------------------------------
P           ndarray    3: 3 elems, type `float64`, 24 bytes
Z           matrix     [[ 0.        ]\n [ 0.9868<...>       ]\n [ 0.99209474]]
b           matrix     [[ 0.11005336]]
fix_L       ndarray    3x1: 3 elems, type `float64`, 24 bytes
fix_L_new   ndarray    1x3: 3 elems, type `float64`, 24 bytes
fix_R       ndarray    3x1: 3 elems, type `float64`, 24 bytes
fix_R_new   ndarray    1x3: 3 elems, type `float64`, 24 bytes
loc_L       ndarray    3x1: 3 elems, type `float64`, 24 bytes
loc_L_new   ndarray    1x3: 3 elems, type `float64`, 24 bytes
loc_R       ndarray    3x1: 3 elems, type `float64`, 24 bytes
loc_R_new   ndarray    1x3: 3 elems, type `float64`, 24 bytes
np          module     <module 'numpy' from '/Us<...>ages/numpy/__init__.pyc'>
th_L        float64    0.565018156928
th_R        float64    -0.562011376014
tmp         ndarray    3: 3 elems, type `float64`, 24 bytes
y           matrix     [[ 0.        ]\n [ 0.0986<...>       ]\n [ 0.11905137]]

In [51]:
y = np.matrix([[loc_L[1,0], fix_L[1,0], loc_R[1,0], fix_R[1,0]]]).T # y vector
Z = np.matrix([[loc_L[2,0], fix_L[2,0], loc_R[2,0], fix_R[2,0]]]).T # Z vector

b = np.linalg.inv(Z.T * Z) * Z.T * y    # least squares solution for b


# PROJECT VECTORS ONTO PLANE to get new point coordinates
fix_L_new  = np.array([[fix_L[0,0], b*fix_L[2,0], fix_L[2,0]]]) # project (x and z are the same, y = bz)
fix_R_new  = np.array([[fix_R[0,0], b*fix_R[2,0], fix_R[2,0]]]) # project

In [52]:
fix_L_new


Out[52]:
array([[  10.,   11.,  100.]])

In [53]:
fix_L = fix_L - loc_L                       # translate fix_L into coordinate system with loc_L at origin
fix_L = fix_L / np.linalg.norm(fix_L)       # make unit length
fix_L = fix_L + loc_L                       # translate back in to cyclopean coordinates

fix_R = fix_R - loc_R                       # translate fix_R into coordinate system with loc_R at origin
fix_R = fix_R / np.linalg.norm(fix_R)       # make unit length
fix_R = fix_R + loc_R                       # translate back in to cyclopean coordinates


# SOLVE FOR PLANE THROUGH loc_L AND loc_R, WHILE MINIMIZING DISTANCE TO fix_L AND fix_R: 
# CONSTRAINED LEAST-SQUARES (solve: y = bz)
# the only degree of freedom is the rotation of the plane around the x axis that runs between loc_L and loc_R
# so we find the linear least squares solution for y = bz
# http://en.wikipedia.org/wiki/Linear_least_squares_(mathematics)

y = np.matrix([[loc_L[1,0], fix_L[1,0], loc_R[1,0], fix_R[1,0]]]).T # y vector
Z = np.matrix([[loc_L[2,0], fix_L[2,0], loc_R[2,0], fix_R[2,0]]]).T # Z vector

b = np.linalg.inv(Z.T * Z) * Z.T * y    # least squares solution for b


# PROJECT VECTORS ONTO PLANE to get new point coordinates
fix_L_new  = np.array([[fix_L[0,0], b*fix_L[2,0], fix_L[2,0]]]) # project (x and z are the same, y = bz)
fix_R_new  = np.array([[fix_R[0,0], b*fix_R[2,0], fix_R[2,0]]]) # project

In [54]:
fix_L_new


Out[54]:
array([[-2.871714  ,  0.10860235,  0.98681541]])

In [55]:
fix_R_new


Out[55]:
array([[ 3.03968379,  0.10918335,  0.99209474]])

In [56]:
# check that elevation angles are the same
    P = np.array([0, -1, b])    # vector normal to the epipolar plane
    P = P / np.linalg.norm(P)               # normalize

    # angle between original vectors and epipolar plane
    th_L = np.degrees(np.arcsin(np.dot( P, (fix_L.T - loc_L.T) / np.linalg.norm(fix_L - loc_L))))
    th_R = np.degrees(np.arcsin(np.dot( P, (fix_R.T - loc_R.T) / np.linalg.norm(fix_R - loc_R))))
    
    th_L_new = np.degrees(np.arcsin(np.dot( P, (fix_L_new.T - loc_L.T) / np.linalg.norm(fix_L_new - loc_L))))
    th_R_new = np.degrees(np.arcsin(np.dot( P, (fix_R_new.T - loc_R.T) / np.linalg.norm(fix_R_new - loc_R))))


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-56-ef02151ee1a1> in <module>()
      4 
      5 # angle between original vectors and epipolar plane
----> 6 th_L = np.degrees(np.arcsin(np.dot( P, (fix_L.T - loc_L.T) / np.linalg.norm(fix_L - loc_L))))
      7 th_R = np.degrees(np.arcsin(np.dot( P, (fix_R.T - loc_R.T) / np.linalg.norm(fix_R - loc_R))))
      8 

ValueError: shapes (3,) and (1,3) not aligned: 3 (dim 0) != 1 (dim 0)

In [57]:
P


Out[57]:
array([ 0.        , -0.99399859,  0.10939288])

In [58]:
# angle between original vectors and epipolar plane
    th_L = np.degrees(np.arcsin(np.dot( P, (fix_L - loc_L) / np.linalg.norm(fix_L - loc_L))))
    th_R = np.degrees(np.arcsin(np.dot( P, (fix_R - loc_R) / np.linalg.norm(fix_R - loc_R))))
    
    th_L_new = np.degrees(np.arcsin(np.dot( P, (fix_L_new - loc_L) / np.linalg.norm(fix_L_new - loc_L))))
    th_R_new = np.degrees(np.arcsin(np.dot( P, (fix_R_new - loc_R) / np.linalg.norm(fix_R_new - loc_R))))

In [59]:
th_L
th_R
th_L_new
th_R_new


Out[59]:
array([-27.97359089,  -0.96539226,  -8.80625425])

In [60]:
th_L


Out[60]:
array([ 0.56501816])

In [61]:
th_R


Out[61]:
array([-0.56201138])

In [62]:
th_L_new


Out[62]:
array([ 22.50717835,  -0.82948173,  -7.55873035])

In [63]:
fix_L_new  = np.array([[fix_L[0,0], b*fix_L[2,0], fix_L[2,0]]]).T # project (x and z are the same, y = bz)
fix_R_new  = np.array([[fix_R[0,0], b*fix_R[2,0], fix_R[2,0]]]).T # project

In [64]:
th_L_new = np.degrees(np.arcsin(np.dot( P, (fix_L_new - loc_L) / np.linalg.norm(fix_L_new - loc_L))))
    th_R_new = np.degrees(np.arcsin(np.dot( P, (fix_R_new - loc_R) / np.linalg.norm(fix_R_new - loc_R))))

In [65]:
th_L_new


Out[65]:
array([ -7.95138670e-16])

In [66]:
th_R_new


Out[66]:
array([ 0.])

In [67]:
P = np.array([0, -1, b])    # vector normal to the epipolar plane
    P = P / np.linalg.norm(P)               # normalize

    # angle between original vectors and epipolar plane
    th_L = np.degrees(np.arcsin(np.dot( P, fix_L / np.linalg.norm(fix_L))))
    th_R = np.degrees(np.arcsin(np.dot( P, fix_R / np.linalg.norm(fix_R ))))
    
    th_L_new = np.degrees(np.arcsin(np.dot( P, (fix_L_new) / np.linalg.norm(fix_L_new))))
    th_R_new = np.degrees(np.arcsin(np.dot( P, (fix_R_new) / np.linalg.norm(fix_R_new))))


  File "<ipython-input-67-46399047134e>", line 2
    P = np.array([0, -1, b])    # vector normal to the epipolar plane
    ^
IndentationError: unexpected indent

In [68]:
P = np.array([0, -1, b])    # vector normal to the epipolar plane
    P = P / np.linalg.norm(P)               # normalize

    # angle between original vectors and epipolar plane
    th_L = np.degrees(np.arcsin(np.dot( P, fix_L / np.linalg.norm(fix_L))))
    th_R = np.degrees(np.arcsin(np.dot( P, fix_R / np.linalg.norm(fix_R ))))
    
    th_L_new = np.degrees(np.arcsin(np.dot( P, (fix_L_new) / np.linalg.norm(fix_L_new))))
    th_R_new = np.degrees(np.arcsin(np.dot( P, (fix_R_new) / np.linalg.norm(fix_R_new))))

In [69]:
th_L_new


Out[69]:
array([ 0.])

In [70]:
th_L


Out[70]:
array([ 0.18597244])

In [71]:
print "Align Eyes Adjustment (L/R in deg)", th_L, th_R


Align Eyes Adjustment (L/R in deg) [ 0.18597244] [-0.17564229]

In [72]:
if np.absolute(th_L_new) > 1e-100 or np.absolute(th_R_new) > 1e-100:
        print "Projection to epipolar plane failed"
    end


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-72-7ddb07bc83b0> in <module>()
      1 if np.absolute(th_L_new) > 1e-100 or np.absolute(th_R_new) > 1e-100:
      2     print "Projection to epipolar plane failed"
----> 3 end

NameError: name 'end' is not defined

In [73]:
if np.absolute(th_L_new) > 1e-100 or np.absolute(th_R_new) > 1e-100:
        print "Projection to epipolar plane failed"

In [74]:
th_L_new = 1

In [75]:
if np.absolute(th_L_new) > 1e-100 or np.absolute(th_R_new) > 1e-100:
        print "Projection to epipolar plane failed"


Projection to epipolar plane failed

In [76]:
if np.absolute(th_L_new) > 1e-100 or np.absolute(th_R_new) > 1e-100:
        raise ValueError("Projection to epipolar plane failed")
        #print "Projection to epipolar plane failed"


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-76-7d5a97ea3e1e> in <module>()
      1 if np.absolute(th_L_new) > 1e-100 or np.absolute(th_R_new) > 1e-100:
----> 2     raise ValueError("Projection to epipolar plane failed")
      3     #print "Projection to epipolar plane failed"

ValueError: Projection to epipolar plane failed

In [76]:


In [77]:
import matplotlib.pyplot as plt

In [78]:
fig = plt.figure()
    plt.plot3( 0, 0, 0, 'bo' );


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-78-a974718e4f9d> in <module>()
      1 fig = plt.figure()
----> 2 plt.plot3( 0, 0, 0, 'bo' );

AttributeError: 'module' object has no attribute 'plot3'

In [79]:
fig = plt.figure()
    plt.plot( 0, 0, 0, 'bo' );

In [80]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes.plot( 0, 0, 0, 'bo' );

In [81]:
%matplotlib inline
    
    fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes.plot( 0, 0, 0, 'bo' );



In [87]:
axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'k')


Out[87]:
[<matplotlib.lines.Line2D at 0x10aafa650>,
 <matplotlib.lines.Line2D at 0x10aafa8d0>]

In [86]:
[loc_L[0],fix_L[0]]


Out[86]:
[array([-3.]), array([-2.871714])]

In [88]:
show


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-88-70fa03b6c3ec> in <module>()
----> 1 show

NameError: name 'show' is not defined

In [89]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes.plot( 0, 0, 0, 'bo' );
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'k')


  File "<ipython-input-89-e61b15895bc4>", line 2
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    ^
IndentationError: unexpected indent

In [90]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes.plot( 0, 0, 0, 'bo' );
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'k')


Out[90]:
[<matplotlib.lines.Line2D at 0x108e61290>,
 <matplotlib.lines.Line2D at 0x108e4aed0>]

In [91]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes.plot( 0, 0, 0, 'ko' );
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'bs')
    axes.plot( [loc_R[0],fix_R[0]], [loc_R[1],fix_R[1]], [loc_R[2],fix_R[2]],'rs')


Out[91]:
[<matplotlib.lines.Line2D at 0x10abe66d0>,
 <matplotlib.lines.Line2D at 0x10aba8910>]

In [92]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes.plot( 0, 0, 0, 'ko' );
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'b')
    axes.plot( [loc_R[0],fix_R[0]], [loc_R[1],fix_R[1]], [loc_R[2],fix_R[2]],'r')


Out[92]:
[<matplotlib.lines.Line2D at 0x10ac4ced0>,
 <matplotlib.lines.Line2D at 0x10ad29190>]

In [93]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes.plot( 0, 0, 0);
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]])
    axes.plot( [loc_R[0],fix_R[0]], [loc_R[1],fix_R[1]], [loc_R[2],fix_R[2]])


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-93-753e228a1564> in <module>()
      1 fig = plt.figure()
      2 axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
----> 3 axes.plot( 0, 0, 0);
      4 axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]])
      5 axes.plot( [loc_R[0],fix_R[0]], [loc_R[1],fix_R[1]], [loc_R[2],fix_R[2]])

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.pyc in plot(self, *args, **kwargs)
   1371         lines = []
   1372 
-> 1373         for line in self._get_lines(*args, **kwargs):
   1374             self.add_line(line)
   1375             lines.append(line)

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in _grab_next_args(self, *args, **kwargs)
    301                 return
    302             if len(remaining) <= 3:
--> 303                 for seg in self._plot_args(remaining, kwargs):
    304                     yield seg
    305                 return

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in _plot_args(self, tup, kwargs)
    263             tup = tup[:-1]
    264         elif len(tup) == 3:
--> 265             raise ValueError('third arg must be a format string')
    266         else:
    267             linestyle, marker, color = None, None, None

ValueError: third arg must be a format string

In [94]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes.plot( 0, 0, 0, 'k' );
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'b')
    axes.plot( [loc_R[0],fix_R[0]], [loc_R[1],fix_R[1]], [loc_R[2],fix_R[2]],'r')


Out[94]:
[<matplotlib.lines.Line2D at 0x10b30b310>,
 <matplotlib.lines.Line2D at 0x10b315590>]

In [95]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    #axes.plot( 0, 0, 0, 'k' );
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'b')
    axes.plot( [loc_R[0],fix_R[0]], [loc_R[1],fix_R[1]], [loc_R[2],fix_R[2]],'r')


Out[95]:
[<matplotlib.lines.Line2D at 0x10b481d50>,
 <matplotlib.lines.Line2D at 0x10b490cd0>]

In [96]:
fix_L


Out[96]:
array([[-2.871714  ],
       [ 0.09868154],
       [ 0.98681541]])

In [97]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')
    #axes.plot( 0, 0, 0, 'k' );
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'b')
    axes.plot( [loc_R[0],fix_R[0]], [loc_R[1],fix_R[1]], [loc_R[2],fix_R[2]],'r')


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-97-33c616340ed7> in <module>()
      1 fig = plt.figure()
      2 axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
----> 3 axes = fig.gca(projection='3d')
      4 #axes.plot( 0, 0, 0, 'k' );
      5 axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'b')

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/figure.pyc in gca(self, **kwargs)
   1253                 kwargs_copy = kwargs.copy()
   1254                 projection_class, _, key = process_projection_requirements(
-> 1255                     self, **kwargs_copy)
   1256 
   1257                 # let the returned axes have any gridspec by removing it from

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/projections/__init__.pyc in process_projection_requirements(figure, *args, **kwargs)
     96 
     97     if isinstance(projection, six.string_types) or projection is None:
---> 98         projection_class = get_projection_class(projection)
     99     elif hasattr(projection, '_as_mpl_axes'):
    100         projection_class, extra_kwargs = projection._as_mpl_axes()

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/projections/__init__.pyc in get_projection_class(projection)
     65         return projection_registry.get_projection_class(projection)
     66     except KeyError:
---> 67         raise ValueError("Unknown projection '%s'" % projection)
     68 
     69 

ValueError: Unknown projection '3d'

In [98]:
from mpl_toolkits.mplot3d import Axes3D

In [99]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')
    #axes.plot( 0, 0, 0, 'k' );
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'b')
    axes.plot( [loc_R[0],fix_R[0]], [loc_R[1],fix_R[1]], [loc_R[2],fix_R[2]],'r')


Out[99]:
[<mpl_toolkits.mplot3d.art3d.Line3D at 0x10bd2ec10>,
 <mpl_toolkits.mplot3d.art3d.Line3D at 0x10bd3cad0>]

In [100]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')
    #axes.plot( 0, 0, 0, 'k' );
    axes.plot( [loc_L[0],fix_L[0]], [loc_L[1],fix_L[1]], [loc_L[2],fix_L[2]],'b-')
    axes.plot( [loc_R[0],fix_R[0]], [loc_R[1],fix_R[1]], [loc_R[2],fix_R[2]],'r-')


Out[100]:
[<mpl_toolkits.mplot3d.art3d.Line3D at 0x10bdf0690>,
 <mpl_toolkits.mplot3d.art3d.Line3D at 0x10bdfb550>]

In [102]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')
    #axes.plot( 0, 0, 0, 'k' );
    axes.plot( loc_L, fix_L,'b')
    axes.plot( loc_R,fix_R,'r')


Out[102]:
[<mpl_toolkits.mplot3d.art3d.Line3D at 0x10ca82b50>]

In [104]:
[xramp,zramp]   = np.meshgrid( np.linspace(-1.5,1.5, 3), np.linspace(-1.5,1.5, 3) );
    yramp           = b*zramp;


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-104-0ca71cd9a2b4> in <module>()
      1 [xramp,zramp]   = np.meshgrid( np.linspace(-1.5,1.5, 3), np.linspace(-1.5,1.5, 3) );
----> 2 yramp           = b*zramp;

/Users/emily/anaconda/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyc in __mul__(self, other)
    339         if isinstance(other, (N.ndarray, list, tuple)) :
    340             # This promotes 1-D vectors to row vectors
--> 341             return N.dot(self, asmatrix(other))
    342         if isscalar(other) or not hasattr(other, '__rmul__') :
    343             return N.dot(self, other)

ValueError: shapes (1,1) and (3,3) not aligned: 1 (dim 1) != 3 (dim 0)

In [ ]:


In [105]:
whos


Variable    Type             Data/Info
--------------------------------------
Axes3D      type             <class 'mpl_toolkits.mplot3d.axes3d.Axes3D'>
P           ndarray          3: 3 elems, type `float64`, 24 bytes
Z           matrix           [[ 0.        ]\n [ 0.9868<...>       ]\n [ 0.99209474]]
axes        Axes3DSubplot    Axes(0.125,0.125;0.775x0.775)
b           matrix           [[ 0.11005336]]
fig         Figure           Figure(480x320)
fix_L       ndarray          3x1: 3 elems, type `float64`, 24 bytes
fix_L_new   ndarray          3x1: 3 elems, type `float64`, 24 bytes
fix_R       ndarray          3x1: 3 elems, type `float64`, 24 bytes
fix_R_new   ndarray          3x1: 3 elems, type `float64`, 24 bytes
loc_L       ndarray          3x1: 3 elems, type `float64`, 24 bytes
loc_L_new   ndarray          1x3: 3 elems, type `float64`, 24 bytes
loc_R       ndarray          3x1: 3 elems, type `float64`, 24 bytes
loc_R_new   ndarray          1x3: 3 elems, type `float64`, 24 bytes
np          module           <module 'numpy' from '/Us<...>ages/numpy/__init__.pyc'>
plt         module           <module 'matplotlib.pyplo<...>s/matplotlib/pyplot.pyc'>
th_L        ndarray          1: 1 elems, type `float64`, 8 bytes
th_L_new    int              1
th_R        ndarray          1: 1 elems, type `float64`, 8 bytes
th_R_new    ndarray          1: 1 elems, type `float64`, 8 bytes
tmp         ndarray          3: 3 elems, type `float64`, 24 bytes
xramp       ndarray          3x3: 9 elems, type `float64`, 72 bytes
y           matrix           [[ 0.        ]\n [ 0.0986<...>       ]\n [ 0.11905137]]
zramp       ndarray          3x3: 9 elems, type `float64`, 72 bytes

In [106]:
yramp = zramp.copy()

In [108]:
yramp = b[0,0]*yramp

In [ ]:


In [109]:
yramp


Out[109]:
array([[-0.16508003, -0.16508003, -0.16508003],
       [ 0.        ,  0.        ,  0.        ],
       [ 0.16508003,  0.16508003,  0.16508003]])

In [110]:
%matplotlib inline
    fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.mesh( xramp, yramp, zramp, 'EdgeColor', [1 0 0] );


  File "<ipython-input-110-8562b725df29>", line 7
    axes.mesh( xramp, yramp, zramp, 'EdgeColor', [1 0 0] );
                                                    ^
SyntaxError: invalid syntax

In [111]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.mesh( xramp, yramp, zramp);


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-111-4c2c6da2b4c9> in <module>()
      4 
      5 # epipolar plane
----> 6 axes.mesh( xramp, yramp, zramp);

AttributeError: 'Axes3DSubplot' object has no attribute 'mesh'

In [112]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.plot_wireframe( xramp, yramp, zramp);



In [113]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.plot_wireframe( xramp, yramp, zramp,'k');


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-113-aa5778039f41> in <module>()
      4 
      5 # epipolar plane
----> 6 axes.plot_wireframe( xramp, yramp, zramp,'k');

/Users/emily/anaconda/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyc in plot_wireframe(self, X, Y, Z, *args, **kwargs)
   1770                   zip(txlines, tylines, tzlines)]
   1771 
-> 1772         linec = art3d.Line3DCollection(lines, *args, **kwargs)
   1773         self.add_collection(linec)
   1774         self.auto_scale_xyz(X, Y, Z, had_data)

/Users/emily/anaconda/lib/python2.7/site-packages/mpl_toolkits/mplot3d/art3d.pyc in __init__(self, segments, *args, **kwargs)
    169         Keyword arguments are passed onto :func:`~matplotlib.collections.LineCollection`.
    170         '''
--> 171         LineCollection.__init__(self, segments, *args, **kwargs)
    172 
    173     def set_sort_zpos(self,val):

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/collections.pyc in __init__(self, segments, linewidths, colors, antialiaseds, linestyles, offsets, transOffset, norm, cmap, pickradius, zorder, **kwargs)
   1049             pickradius=pickradius,
   1050             zorder=zorder,
-> 1051             **kwargs)
   1052 
   1053         self.set_segments(segments)

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/collections.pyc in __init__(self, edgecolors, facecolors, linewidths, linestyles, antialiaseds, offsets, transOffset, norm, cmap, pickradius, hatch, urls, offset_position, zorder, **kwargs)
    109         self.set_edgecolor(edgecolors)
    110         self.set_facecolor(facecolors)
--> 111         self.set_linewidth(linewidths)
    112         self.set_linestyle(linestyles)
    113         self.set_antialiased(antialiaseds)

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/collections.pyc in set_linewidth(self, lw)
    450         if lw is None:
    451             lw = mpl.rcParams['patch.linewidth']
--> 452         self._linewidths = self._get_value(lw)
    453 
    454     def set_linewidths(self, lw):

/Users/emily/anaconda/lib/python2.7/site-packages/matplotlib/collections.pyc in _get_value(val)
    136     def _get_value(val):
    137         try:
--> 138             return (float(val), )
    139         except TypeError:
    140             if cbook.iterable(val) and len(val):

ValueError: could not convert string to float: k

In [114]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.plot_wireframe( xramp, yramp, zramp);

    #cyclopean eye
    axes.plot( 0, 0, 0, 'k' );


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-114-f40c72d4d779> in <module>()
      7 
      8 #cyclopean eye
----> 9 axes.plot( 0, 0, 0, 'k' );

/Users/emily/anaconda/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyc in plot(self, xs, ys, *args, **kwargs)
   1515         # Match length
   1516         if not cbook.iterable(zs):
-> 1517             zs = np.ones(len(xs)) * zs
   1518 
   1519         lines = Axes.plot(self, xs, ys, *args[argsi:], **kwargs)

TypeError: object of type 'int' has no len()

In [126]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.plot_wireframe( xramp, yramp, zramp);

    #cyclopean eye
    axes.plot( [0.], [0.], [0.],'ko')
    axes.plot( [loc_L[0,0],fix_L[0,0]], [loc_L[1.0],fix_L[1,0]], [loc_L[2,0],fix_L[2,0]],'c')


Out[126]:
[<mpl_toolkits.mplot3d.art3d.Line3D at 0x10509c3d0>]

In [127]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.plot_wireframe( xramp, yramp, zramp);

    #cyclopean eye
    axes.plot( [0.], [0.], [0.],'ko')
    # original gaze vectors
    axes.plot( [loc_L[0,0],fix_L[0,0]], [loc_L[1.0],fix_L[1,0]], [loc_L[2,0],fix_L[2,0]],'c')
    axes.plot( [loc_R[0,0],fix_R[0,0]], [loc_R[1,0],fix_R[1,0]], [loc_R[2,0],fix_R[2,0]],'m')
    # new gaze vectors
    axes.plot( [loc_L[0,0],fix_L_new[0,0]], [loc_L[1,0],fix_L_new[1,0]], [loc_L[2],0,fix_L_new[2,0]],'g')
    axes.plot( [loc_R[0,0],fix_R_new[0,0]], [loc_R[1,0],fix_R_new[1,0]], [loc_R[2,0],fix_R_new[2,0]],'r')


Out[127]:
[<mpl_toolkits.mplot3d.art3d.Line3D at 0x10e4d1e90>]
/Users/emily/anaconda/lib/python2.7/site-packages/IPython/core/formatters.py:239: FormatterWarning: Exception in image/png formatter: operands could not be broadcast together with shapes (3,) (2,) 
  FormatterWarning,
<matplotlib.figure.Figure at 0x10e26b290>

In [128]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.plot_wireframe( xramp, yramp, zramp);

    #cyclopean eye
    axes.plot( [0.], [0.], [0.],'ko')
    # original gaze vectors
    axes.plot( [loc_L[0,0],fix_L[0,0]], [loc_L[1.0],fix_L[1,0]], [loc_L[2,0],fix_L[2,0]],'c')
    axes.plot( [loc_R[0,0],fix_R[0,0]], [loc_R[1,0],fix_R[1,0]], [loc_R[2,0],fix_R[2,0]],'m')
    # new gaze vectors
    axes.plot( [loc_L[0,0],fix_L_new[0,0]], [loc_L[1,0],fix_L_new[1,0]], [loc_L[2,0],fix_L_new[2,0]],'g')
    axes.plot( [loc_R[0,0],fix_R_new[0,0]], [loc_R[1,0],fix_R_new[1,0]], [loc_R[2,0],fix_R_new[2,0]],'r')


Out[128]:
[<mpl_toolkits.mplot3d.art3d.Line3D at 0x10ce74850>]

In [129]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.plot_wireframe( xramp, yramp, zramp);

    #cyclopean eye
    axes.plot( [0.], [0.], [0.],'ko')
    # original gaze vectors
    axes.plot( [loc_L[0,0],fix_L[0,0]], [loc_L[1.0],fix_L[1,0]], [loc_L[2,0],fix_L[2,0]],'c')
    axes.plot( [loc_R[0,0],fix_R[0,0]], [loc_R[1,0],fix_R[1,0]], [loc_R[2,0],fix_R[2,0]],'m')
    # new gaze vectors
    axes.plot( [loc_L[0,0],fix_L_new[0,0]], [loc_L[1,0],fix_L_new[1,0]], [loc_L[2,0],fix_L_new[2,0]],'g')
    axes.plot( [loc_R[0,0],fix_R_new[0,0]], [loc_R[1,0],fix_R_new[1,0]], [loc_R[2,0],fix_R_new[2,0]],'r')


Out[129]:
[<mpl_toolkits.mplot3d.art3d.Line3D at 0x10e6b2850>]

In [130]:
#points for epipolar plane
    [xramp,zramp]   = np.meshgrid( np.linspace(-4,4, 3), np.linspace(-4,4, 3) );
    yramp           = zramp.copy()
    yramp           = b[0,0]*yramp

    %matplotlib inline
    fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    axes = fig.gca(projection='3d')

    # epipolar plane
    axes.plot_wireframe( xramp, yramp, zramp);

    #cyclopean eye
    axes.plot( [0.], [0.], [0.],'ko')
    # original gaze vectors
    axes.plot( [loc_L[0,0],fix_L[0,0]], [loc_L[1.0],fix_L[1,0]], [loc_L[2,0],fix_L[2,0]],'c')
    axes.plot( [loc_R[0,0],fix_R[0,0]], [loc_R[1,0],fix_R[1,0]], [loc_R[2,0],fix_R[2,0]],'m')
    # new gaze vectors
    axes.plot( [loc_L[0,0],fix_L_new[0,0]], [loc_L[1,0],fix_L_new[1,0]], [loc_L[2,0],fix_L_new[2,0]],'g')
    axes.plot( [loc_R[0,0],fix_R_new[0,0]], [loc_R[1,0],fix_R_new[1,0]], [loc_R[2,0],fix_R_new[2,0]],'r')


Out[130]:
[<mpl_toolkits.mplot3d.art3d.Line3D at 0x10f27ca90>]

In [131]:
fig = plt.figure()
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)
    #axes = fig.gca(projection='3d')

    # epipolar plane
    axes.plot_wireframe( xramp, yramp, zramp);

    #cyclopean eye
    axes.plot( [0.], [0.], [0.],'ko')
    # original gaze vectors
    axes.plot( [loc_L[0,0],fix_L[0,0]], [loc_L[1.0],fix_L[1,0]], [loc_L[2,0],fix_L[2,0]],'c')
    axes.plot( [loc_R[0,0],fix_R[0,0]], [loc_R[1,0],fix_R[1,0]], [loc_R[2,0],fix_R[2,0]],'m')
    # new gaze vectors
    axes.plot( [loc_L[0,0],fix_L_new[0,0]], [loc_L[1,0],fix_L_new[1,0]], [loc_L[2,0],fix_L_new[2,0]],'g')
    axes.plot( [loc_R[0,0],fix_R_new[0,0]], [loc_R[1,0],fix_R_new[1,0]], [loc_R[2,0],fix_R_new[2,0]],'r')


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-131-80a6b20ae48d> in <module>()
      4 
      5 # epipolar plane
----> 6 axes.plot_wireframe( xramp, yramp, zramp);
      7 
      8 #cyclopean eye

AttributeError: 'Axes' object has no attribute 'plot_wireframe'

In [132]:
import mpld3


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-132-25a6968c2f16> in <module>()
----> 1 import mpld3

ImportError: No module named mpld3

In [133]:
%matplotlib inline
    import mpld3
    mpld3.enable_notebook()


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-133-553934187831> in <module>()
      1 get_ipython().magic(u'matplotlib inline')
----> 2 import mpld3
      3 mpld3.enable_notebook()

ImportError: No module named mpld3

In [ ]: