我想绘制URDU文本的单词向量。当我编译源代码时,它执行得相当,但是在结果图中出现空白框而不是乌尔都语文本。我需要乌尔都语文本而不是盒子。这是我的源代码:
import numpy as np
import codecs
la = np.linalg
words = ['امریکی','صدر','خبردار','شمالی کوریا','کے','میزائل','اور','.']
arr = np.array([[0,2,1,0,0,0,0,0],
[2,0,0,1,0,1,0,0],
[1,0,0,0,0,0,1,0],
[0,0,0,1,0,0,0,1],
[0,1,0,0,0,0,0,1],
[0,0,1,0,0,0,0,8],
[0,2,1,0,0,0,0,0],
[0,0,1,1,1,0,0,0]])
u, s, v = la.svd(arr, full_matrices=False)
import matplotlib.pyplot as plt
for i in range(len(words)):
plt.text(u[i,2], u[i,3], words[i])
plt.show()