0
print("cols",cols)
for i in range(cols):
    j = "%s" % i
    plt.plot(datasetAfterDrop.iloc[:,i])
    plt.show()
    plt.savefig('var'+ '_'+ j + '.jpg')
    print('-' * 100)

Here cols are number of columns in csv file. The above loop is forming 3 different graph for each column. I wanted to named each graph dynamically for which I used, plt.savefig('var'+ '_'+ j + '.jpg') So that I can use each image and find peak of each graph. Can someone help.

Moreover, each plot is getting saved but when I am opening the image it is showing white box.

auriX007
  • 13
  • 1
  • 1
    Does this answer your question? [Saving a figure after invoking pyplot.show() results in an empty file](https://stackoverflow.com/questions/21875356/saving-a-figure-after-invoking-pyplot-show-results-in-an-empty-file) – fernandezr Sep 30 '22 at 08:08

0 Answers0