I'm trying to put text in a graph, but for some reason I can't do it using plt.text. I get the
TypeError: can only concatenate list ("not float") to list
I don't really know what to change to get this working.
x = [3, 1, 4, 5, 1]
y = [5, 4, 4, 3, 7]
fig=plt.figure(1)
ax = fig.add_subplot(1, 1, 1)
plt.xlim(0.5, 7)
plt.ylim(0, 7.5)
ax.spines['left'].set_position('center')
ax.spines['bottom'].set_position('center')
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
plt.scatter(x, y, marker="x", color="red")
Names=['name1', 'name2', 'name3', 'name4', 'name4']
plt.text(x + 0.1, y + 0.1, Names, fontsize=9)

text, it's withx+0.1andy+0.1, which you would be more aware of if you processed and posted the whole errorplt.textand adding 0.1 to x and y which are of typelist