title: Video out of frames with colorbar with openCV
body: <p>I have a list of frames (Array float64, 128x128) with temperature data for every pixel. I would like to generate a video out of the frames with a colorbar on the side to show the temperature. I thought about saving all the frames as pictures and reading them in again, but this doesn't seem to be efficient. Is there a better way to work directly with arrays and matplotlib?</p>
  <p>I would write the video with following code:</p>
  <pre><code>out = cv2.VideoWriter(&quot;Output.avi&quot;,cv2.VideoWriter_fourcc('M','J','P','G'),10, (128,128))
  for frame in frames:
      out.write(frame)
  out.release()
  </code></pre>
  <p>And this is one image I have from one of the frames:
  I used following code for the image:</p>
  <pre><code>plt.imshow(frame,interpolation='nearest',  origin='lower')
  plt.colorbar()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Mdwdp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mdwdp.png" alt="enter image description here" /></a></p>