2016-03-03 45 views
0

我搜索互联网,在matplotlib中找不到像在①中输入特殊字符的任何内容。
是否有代码表示要在图中显示的“①”?在matplotlib中绘制特殊字符①①

现在,我使用:

## the ① character was found on the Internet, and I clipped it. 
ax.text(0.425, 0.475, u'①', ha='center') 

我认为必须有一些函数生成①,②,③,④......作为一种特殊字符的

回答

4

带圆圈的数字开始在Unicode码点0x2460,至多到20所以只写一个返回所需的字符一个小帮手功能:

def circled(x): 
    return chr(0x245F+x) # Python 2: use unichr() instead of chr() 

用法:

ax.text(0.425, 0.475, circled(1), ha='center') 
+0

非常感谢!它工作得很好。 –