title: Cartesian axis labels in matplotlib
body: <p>I have the following code:</p>
  
  <pre><code>from mpl_toolkits.axes_grid.axislines import SubplotZero
  import matplotlib.pyplot as plt
  import numpy
  
  if 1:
      fig = plt.figure(1)
      ax = SubplotZero(fig, 111)
      fig.add_subplot(ax)
  
      ax.axhline(linewidth=2.0, color="black")
      ax.axvline(linewidth=2.0, color="black")
  
      ax.set_xticks([1])
      ax.set_yticks([1])
      ax.set_xticklabels(['x'])
      ax.set_yticklabels(['y'])
  
      for direction in ["xzero", "yzero"]:
          ax.axis[direction].set_axisline_style("-|&gt;")
          ax.axis[direction].set_visible(True)
  
      for direction in ["left", "right", "bottom", "top"]:
          ax.axis[direction].set_visible(False)
  
      x = numpy.linspace(-0.5, 1., 100)
      ax.plot(x, numpy.sin(x*numpy.pi), linewidth=2.0)
  
      plt.show()
  </code></pre>
  
  <p>which produces this graph:</p>
  
  <p><img src="https://i.stack.imgur.com/ODm7I.png" alt="graph"></p>
  
  <p>Two things:</p>
  
  <ol>
  <li>The "y" label is on its side - how do I make it vertical?</li>
  <li>Both "x" and "y" labels are not on the line of the axis - I want them to appear directly after the axis arrows.</li>
  </ol>