您需要一种具有给定Unipre字符的字体,STIX字体应包含星号。您需要找到或下载STIX字体,当然,使用给定符号的任何其他ttf文件也应该可以。
import matplotlib.pyplot as pyplotfrom matplotlib.font_manager import FontPropertiesif __name__ == "__main__": pyplot.figure() prop = FontProperties() prop.set_file('STIXGeneral.ttf') pyplot.xlabel(u"u2736", fontproperties=prop) pyplot.show()


