How to plot a Dynamic 3D graph using matplotlib?

I was able to plot dynamic 2D graphs, where my input was an audio using pyaudio. I want to create a Dynamic 3D graph using the same input. assuming the 3rd axes to be any mathematic operation. I cant find any way to update the 3D graph with time.(I was able to make a static 3D graph with the same input)