# Author: Ika, 2013-07-27
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp
import random
plt.figure()
plt.axes([0.17,0.13,0.79,0.8])
plt.hold(True)
Q = []
# Draw the hyperbola.
# Quadrant I
X = np.arange(2.00, 10.01, 0.01)
Y = np.sqrt(X*X-4)
a = plt.plot(X, Y, '-', color='red', lw=2)
Q.append(a)
# Quadrant II
X = np.arange(-10.00, -1.99, 0.01)
Y = np.sqrt(X*X-4)
a = plt.plot(X, Y, '-', color='red', lw=2)
Q.append(a)
# Quadrant III
X = np.arange(-10.00, -1.99, 0.01)
Y = -np.sqrt(X*X-4)
a = plt.plot(X, Y, '-', color='red', lw=2)
Q.append(a)
# Quadrant IV
X = np.arange(2.00, 10.01, 0.01)
Y = -np.sqrt(X*X-4)
a = plt.plot(X, Y, '-', color='red', lw=2)
Q.append(a)
plt.xlim(-10,10)
plt.ylim(-10,10)
# Set up the spines
ax = plt.gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data',0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data',0))
# Set label
ax.text(1,8,r'$x^2-y^2=4$',fontsize=24)
plt.savefig("Hyperbola2_SVG.svg")