In [1]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

In [2]:
with plt.xkcd():
    x = np.linspace(-2*np.pi, 2*np.pi, 100)
    y = np.sin(x)
    plt.plot(x, y, label='y = sin x')
    plt.legend(loc=3)



In [6]:
with plt.xkcd():
    plt.arrow(0, 0, 2, 3, head_length=0.3, head_width=0.25, length_includes_head=True)
    plt.xlim(-1, 3)
    plt.ylim(-1, 4)



In [4]:
fig, ax = plt.subplots(1, figsize=(4, 4))
x = np.linspace(-2*np.pi, 2*np.pi, 100)
y = np.cos(x)
ax.set_xlim(-2*np.pi, 2*np.pi)
ax.set_ylim(-1.5, 1.5)
plt.plot(x, y)


Out[4]:
[<matplotlib.lines.Line2D at 0xb6ed581908>]

In [ ]: