def image(image_name): # Pulls in the analyzer and creates the DataFrame data = instagram_analyzer(image_name, 0) # formats the DataFrame to display plots instagram_graph(data) # renders matplotlib image to Flask view canvas = FigureCanvas(plt.gcf()) output = StringIO() canvas.print_png(output) response = make_response(output.getvalue()) response.mimetype = 'image/png' return response
def image(image_name): # create the DataFrame instagram_analyzed = instagram_analyzer(image_name) # format the DataFrame to display plots instagram_graph(instagram_analyzed) # render matplotlib image to Flask view canvas = FigureCanvas(plt.gcf()) output = StringIO() canvas.print_png(output) # create response response = make_response(output.getvalue()) response.mimetype = 'image/png' return response
def image(image_name): # pulls in the scraper and creates the DataFrame instagram_analyzed = instagram_analyzer(image_name) # formats the DataFrame to display plots instagram_graph(instagram_analyzed) # rendering matplotlib image to Flask view canvas = FigureCanvas(plt.gcf()) output = StringIO() canvas.print_png(output) # make_response converts the return value from a view # function to a real response object that is an instance # of response_class. response = make_response(output.getvalue()) response.mimetype = "image/png" return response
def image(image_name): # pulls in the scraper and creates the DataFrame instagram_analyzed = instagram_analyzer(image_name) # formats the DataFrame to display plots instagram_graph(instagram_analyzed) # rendering matplotlib image to Flask view canvas = FigureCanvas(plt.gcf()) output = StringIO() canvas.print_png(output) # make_response converts the return value from a view # function to a real response object that is an instance # of response_class. response = make_response(output.getvalue()) response.mimetype = 'image/png' return response