Leandro Ciscar
Leandro Ciscar

Reputation: 25

Display FileName of a Image Python imshow

Please,

I'm trying to display the filename of a jpeg but i could not find how to. I want to display the image + the filename of the image.

img_dir = "paintings/"
data_path = os.path.join(img_dir,'*g')
files = glob.glob(data_path)
data = []
for f1 in files:
    img = imageio.imread(f1)
    data.append(img)

plt.imshow(data[40])

enter image description here

Thanks

Upvotes: 0

Views: 838

Answers (1)

adrtam
adrtam

Reputation: 7241

You can try plt.title(filename):

Upvotes: 1

Related Questions