title: Plotting numpy rfft
body: <p>I am trying to plot the fft of a wav file, I have successfully completed it using the regular fft but I wanted to experiment with <code>rfft</code> as my application was to perform this in music.  When I try to plot <code>xf</code> and <code>yf</code> (figure 2) I run into an issue where <code>xf</code> is half the length of <code>yf</code> and I can't figure out why, I assume its due to the negative frequencies missing but I thought changing both function calls to <code>rfft</code> and <code>rfftfreq</code> would handle it.</p>
  
  <pre><code>import numpy as np
  import soundfile as sf
  import matplotlib.pyplot as plt
  
  square = 'square.wav'
  sine = 'sine.wav'
  k = '1Khz.wav'
  cello = 'cello.wav'
  data, fs = sf.read(k)
  
  #Plot the Signal
  N = len(data)
  T = 1.0/fs
  x = np.linspace(0, (N*T), N)
  plt.plot(x, data)
  plt.grid()
  count = 0
  
  yf = np.fft.rfft(data)
  xf = np.fft.rfftfreq(yf.size, d=T)
  
  plt.figure(2)
  plt.plot(xf, yf)
  plt.show()
  </code></pre>