Skip to content

Instantly share code, notes, and snippets.

@dice89
Last active December 23, 2018 09:22
Show Gist options
  • Save dice89/abe836cff39d22ea8f5ff6af435df53b to your computer and use it in GitHub Desktop.
Save dice89/abe836cff39d22ea8f5ff6af435df53b to your computer and use it in GitHub Desktop.
from flask import Flask, send_file, make_response,
from plot import do_plot
app = Flask(__name__)
@app.route('/plots/breast_cancer_data/correlation_matrix', methods=['GET'])
def correlation_matrix():
bytes_obj = do_plot()
return send_file(bytes_obj,
attachment_filename='plot.png',
mimetype='image/png')
if __name__ == '__main__':
app.run(debug=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment