text: import numpy as np
  import matplotlib.pyplot as plt
  
  x = np.linspace(-np.pi, np.pi, 256, endpoint=True)
  c, s = np.cos(x), np.sin(x)
  
  plt.plot(x, c, color="blue", linewidth=2.0, linestyle="-", label="cosine")
  plt.plot(x, s, color="red",  linewidth=2.0, linestyle="-", label="sine")
  plt.legend(loc='upper left', frameon=False)
  
  plt.xlim(x.min()*1.1, x.max()*1.1)
  plt.xticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi],
             [r'$-\pi$', r'$-\pi/2$', r'$0$', r'$+\pi/2$', r'$+\pi$'])
  plt.ylim(c.min()*1.1, c.max()*1.1)
  plt.yticks([-1, 0, 1])
  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))
  
  plt.show()
  