在matplotlib中是否有方法plt.annotate()使得每个子列表显示在新行中?我正在尝试根据我在下面注释掉的代码来实现某些东西。基本上,我试图消除对每个子列表单独注释的需要,因为不知道子列表的数量,并且我正在寻找一种比循环更好的方法来实现它。
import matplotlib.pyplot as plt
x = [['A','B','C'],['X','Y','Z'],['D','E']]
plt.annotate(x[0],xy=(0.5,0.5))
plt.annotate(x[1],0.4))
plt.annotate(x[2],0.3))
#plt.annotate(x,0.5)) Is there a way that each sublist is shown in a new line automatically
plt.show()