I'm currently saving two matplotlib graphs to /static folder on a Flask application.
However, when they render in HTML. They both render the first image only. Not two separate images as I would expect.
name_img_1 = 'static/1.png?%d' % time.time()
name_img_2 = 'static/2.png?%d' % time.time()
plt.plot( 'Time stamp 1', 'pred1', data=data, linestyle='-', marker='o')
plt.title(' classifier 1')
plt.axhline(y=0.55,label='Threshold (=0.55)')
plt.legend()
plt.savefig(name_img_1,format='png')
plt.plot( 'Time stamp 1', 'pred2', data=data, linestyle='-', marker='o')
plt.title(' classifier 1')
plt.axhline(y=0.55,label='Threshold (=0.72)')
plt.legend()
plt.savefig(name_img_2,format='png')
return render_template("hello.html",user_image=name_img_1,user_image_2=name_img_3,form=form)
HTML code
<img src="{{ user_image }}" alt="User Image">
<img src="{{ user_image_2 }}" alt="User Imageq23">
I've tried creating two separate static folders and subdirectories but neither work.