I'm having trouble saving histogram plots from a "for loop" into multiple pdf files.
I have tried the .savefig() and the img2pdf.
for i,title in enumerate(titles):
count, bins, ignored = plt.hist(dists[i], 50, normed=True, range=
[450,1700])
plt.title(title)
plt.xlabel("g CO2-eq/day-bed " )
plt.ylabel("Frequency")
plt.show()
plt.savefig[i]("nitrileglob1.pdf",bbox_inches='tight')
I either save one plot or none of them get saved. I want to save each of the dists[i] into a pdf file. The last line is not really working...