title: What is the best way to plot a spectrogram with openGL
body: <p>I have written a code to calculate the spectrogram of a sine &amp; cos signals, applied the Hann Window, calculated FFT, Calculated log magnitude of frequency coefficients.</p>
  <p>I tested that it is all working by writing a simple function in openGL to plot a magnitude-frequency spectrum and I got the following results:</p>
  <p><a href="https://i.stack.imgur.com/6watg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6watg.png" alt="enter image description here" /></a></p>
  <p>As you can see, there are 2 bars which indicates the sine * cos waves.</p>
  <p>I have all the information I need to plot a <a href="https://upload.wikimedia.org/wikipedia/commons/c/c5/Spectrogram-19thC.png" rel="nofollow noreferrer">spectrogram</a> (frequencies,magnitude,time)
  Now my question is how can I draw that? my first thought was to draw dots, so I'll use the time array for the interval time I need to draw the dots on the X axie, frequencies array to where to draw them on the Y axis, and the magnitude would be the color of the dot.</p>
  <p>Maybe that's an inefficient idea because I saw that drawing dots is really inefficient in openGL so I don't know what's a better idea, I couldn't find any &quot;simple&quot; examples of openGL spectrogram online.</p>