title: How to Display Image in Flask after a button is pressed
body: <p>I am new to flask and web development. I want to display an image on a local web server after I press a button on the webpage. I am using Flask.Ive been trying to figure this out for a while and havent been able too so any help would be incredible. 
  FLASK CODE:</p>
  
  <pre><code>@app.route('/graph_select')
  def graph_select():
      return render_template('live_stream.html')
  
  
  @app.route('/read_ph', methods=["GET"])
  def ph_plot():
      if request.method == "GET":
          all_plots.ph_plot()
          return render_template('live_stream.html')
  
  
  @app.route("/read_temp", methods=["GET"])
  def temp_plot():
      if request.method == "GET":
          all_plots.temperature_plot()
          return render_template('live_stream.html')
  
  
  @app.route('/read_distance', methods=["GET"])
  def distance_plot():
      if request.method == "GET":
          all_plots.distance_plot()
          return render_template('live_stream.html')
  </code></pre>
  
  <p>HTML CODE:
      
        </p>
  
  <pre><code>    &lt;h1&gt;Data Monitoring Station&lt;/h1&gt;
  
        &lt;form method="GET" 
          &lt;a href="read_temp"&gt;&lt;button type="button"&gt;Temperature Graph&lt;/button&gt;&lt;/a&gt;
          &lt;a href="read_ph"&gt;&lt;button type="button"&gt;PH Graph&lt;/button&gt;&lt;/a&gt;
          &lt;a href="read_distance"&gt;&lt;button type="button"&gt;Distance Graph&lt;/button&gt;&lt;/a&gt;
        &lt;/form&gt;
  
      &lt;h3&gt;&lt;img src="{{ url_for('static', filename='ph_plot.png') }}" width="30%"&gt;$
      &lt;h3&gt;&lt;img src="{{ url_for('static', filename='temperature_plot.png') }}" width="30%"&gt;$
      &lt;h3&gt;&lt;img src="{{ url_for('static', filename='distance_plot.png') }}" width="30%"&gt;$
  
  
  
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>