Home » Python » matplotlib – python networkx – problem with Persian characters-Exceptionshub

matplotlib – python networkx – problem with Persian characters-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:

Why output of this graph doesn’t show correct string?

import networkx as nx
import matplotlib.pyplot as plt
G = nx.DiGraph()
G.add_edge("محمد رضا","رضایی زاده حسین")
nx.draw(G,encoding='utf-8', with_labels=True)
plt.savefig("path.png")
plt.show()

enter image description here

How to&Answers: