title: Automatically upload matplotlib plot to very simple http server
body: <p>I am trying to set up a very simple http site on my local machine with this code.</p>
  <pre><code>from http.server import HTTPServer, BaseHTTPRequestHandler
  
  class Handler(BaseHTTPRequestHandler):
      def do_GET(self):
          self.send_response(200)
          self.send_header(&quot;content-type&quot;, &quot;text/html&quot;)
          self.end_headers()
          self.wfile.write(&quot;hello world&quot;.encode())
  
  
  def main():
      PORT = 8000
      server = HTTPServer((&quot;&quot;, PORT), Handler)
      print(f&quot;Server running on port {PORT}&quot;)
      server.serve_forever()
  
  
  if __name__ == &quot;__main__&quot;:
      main()
  
  </code></pre>
  <p>Ultimately, I want to setup the site in a way, that it displays a matplotlib plot, which I am generating with my machine. I accomplished this with the <code>mpld3</code> package.
  The problem is, that my python code continuously updates the plot (it is displaying the temperature over time), and the <code>mpld3</code> generated image is static.</p>
  <p>If anyone could point out how I can send the newly generated plot to the HTTP site to be displayed every X seconds, I would be very happy.</p>
  <p>Cheers!</p>