title: How can i plot the sum of two sine waves with different frequencies
body: <p>I am trying to plot the sum of two sine waves of different frequencies in python - I have done this in excel and now want to replicate this in Python.</p>
  
  <p>Thank you.</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plot
  
  orbitperiod = .36
  lumorbitperiod = 3.25
  synodicperiod = 1/abs((1/orbitperiod)-(1/lumorbitperiod))
  highesthigh = 3112
  lowesthigh = 2709
  highestlow = 2023
  lowestlow = 1665
  halfofhighrange = abs(highesthigh-highestlow)/2
  halfoflowrange = abs(highestlow-lowestlow)/2
  lowmean = (highestlow+lowestlow)/2
  
  time        = np.arange(0, 5, 0.01);
  
  #plot first sine wave
  plot.plot(time*365*orbitperiod, \
        (np.sin(time*np.pi*2)*halfoflowrange+lowmean))
  
  #plot second sine wave
  plot.plot(time*365*synodicperiod, \
        (np.sin(time*np.pi*2)*halfofhighrange+halfofhighrange))
  </code></pre>
  
  <p>I'd like to have one plot of the sum of the sine waves instead of two separate sine waves.</p>