我使用了所有正确的编码,并且该软件可以正常工作,但是阿拉伯字母未连接(大多数阿拉伯字母彼此相邻时已连接)
这是情节显示图像的方式
我使用条形图功能使用python Pandas模块
唯一可以解决此问题的方法是,将需要绘制的Pandas列中的所有阿拉伯语单词用arabic_reshaper
进行绘制和整形,并将它们附加到列表中,并将此列表作为x轴:
# reshaping the arabic words to show correctly on matplotlib
import arabic_reshaper
import matplotlib.pyplot as plt
from bidi.algorithm import get_display
x = [ ]
for item in df.column_name.values:
x.append(get_display(arabic_reshaper.reshape(item)))
当然,您需要先安装arabic_reshaper
和bidi.algorithm
软件包