简体   繁体   中英

python - best way to add a long text below plots and save this into a pdf

I have a large set of photos, in which I detected several objects in every photo. I want to create a pdf including all photos and the name of the identified object, written below (not within) each photo. As there are many photos which have many objects I cannot write it within the photo or use a legend / axis name to include them. What would you suggest as best approach / library in python or other language for this problem?

@Entropie_13, just addressing here your comment with an example. You can use the text function from matplotlib to put the text wherever you want on the figure. Below is an example with text on each side of the figure. The code would look like that:

import matplotlib.pyplot as plt
import numpy as np

N_points=10
x=np.arange(N_points)
y=np.arange(N_points)
plt.plot(x,y)
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.text(3.5,-8,'text bottom')
plt.text(-8,3.5,'text left')
plt.text(3.5,16,'text top')
plt.text(16,3.5,'text right')
plt.show()

And the code outputs:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM