konstantint / matplotlib-venn

Area-weighted venn-diagrams for Python/matplotlib
MIT License
496 stars 67 forks source link

Can't use Chinese #9

Closed gavinking0110 closed 10 years ago

gavinking0110 commented 10 years ago

Hi!

As I try to use it with Chinese, it just show some empty rectangles. Could anybody fix this problem? Or maybe is my fault to ignore something important? Thanks for your response~

Best regards, Gavin

konstantint commented 10 years ago

This is obviously because the font, that matplotlib uses to display labels by default, does not contain Chinese characters. Try setting some font, that does, e.g.

matplotlib.rcParams['font.sans-serif'] = 'SimHei'
v = venn2((1,1,1), (u'中国',u'语言'))

This seems to work in my case.