In [11]:
import numpy as np
import matplotlib.pyplot as plt

def Cij(e, d, y, p, Vp, Vs):
    """
    Returns the elastic stiffness elements C11, C33, C13, C55, and C66 that
    characterize transversely isotropic materials, using the Thomsen parameters
    and elastic parameters.
    """
    C = np.zeros(shape=(6, 6))
    f = 1 - (Vs/Vp)**2
    dtil = f*(np.sqrt(1 + 2*d/f) - 1)

    C[0][0] = p*Vp**2*(1 + 2*e)
    C[1][1] = C[0][0]
    C[2][2] = p*Vp**2
    C[3][3] = p*Vp**2*(1 - f)
    C[4][4] = C[3][3]
    C[5][5] = p*Vp**2*(1 - f)*(1 + 2*y)
    C[0][2] = p*Vp**2*(2*f + dtil - 1)
    C[2][0] = C[0][2]
    C[0][1] = C[0][0] - 2*C[5][5]
    C[1][0] = C[0][1]

    return(C)

p = 2600
vp = 2260
vs = 1428
chi = 0
e = 0
d = 0
y = 0
C = Cij(e, d, y, p, vp, vs)

phi = np.arange(0, 180, 1)
phi = np.radians(phi)
theta = np.arange(0, 90, 1)
theta = np.radians(theta)

chi = np.radians(chi)

S = np.zeros(shape=(181, 91))

schi = np.sin(chi)
cchi = np.cos(chi)
G1 = [[cchi**2, schi**2, 0, 0, 0, 2*cchi*schi],
      [schi**2, cchi**2, 0, 0, 0, -2*schi*cchi],
      [0, 0, 1, 0, 0, 0],
      [0, 0, 0, cchi, -schi, 0],
      [0, 0, 0, schi, cchi,  0],
      [-cchi*schi, cchi*schi, 0, 0, 0, cchi**2 - schi**2]]
G1 = np.asarray(G1)
# Rotate stiffness matrices
C = G1.dot(C).dot(G1.T)

plt.figure(1)
plt.plot(phi, theta, S)


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-11-69857cb9f823> in <module>()
     56 
     57 plt.figure(1)
---> 58 plt.plot(phi, theta, S)

C:\Python34\lib\site-packages\matplotlib\pyplot.py in plot(*args, **kwargs)
   3097         ax.hold(hold)
   3098     try:
-> 3099         ret = ax.plot(*args, **kwargs)
   3100         draw_if_interactive()
   3101     finally:

C:\Python34\lib\site-packages\matplotlib\axes\_axes.py 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)

C:\Python34\lib\site-packages\matplotlib\axes\_base.py in _grab_next_args(self, *args, **kwargs)
    302                 return
    303             if len(remaining) <= 3:
--> 304                 for seg in self._plot_args(remaining, kwargs):
    305                     yield seg
    306                 return

C:\Python34\lib\site-packages\matplotlib\axes\_base.py in _plot_args(self, tup, kwargs)
    264             tup = tup[:-1]
    265         elif len(tup) == 3:
--> 266             raise ValueError('third arg must be a format string')
    267         else:
    268             linestyle, marker, color = None, None, None

ValueError: third arg must be a format string