0

Unable to print tamil words correctly in matplotlib plot function.

Here is my code:

xx=['என்று', 'தான்', 'ஒரு', 'இந்த']
yy=[1,3,2,5]

import matplotlib.pyplot as plt

plt.rc('font', family='Vijaya')
plt.plot(xx,yy, 'go-')
plt.xlabel("சொற்கள்")
plt.ylabel("எண்ணிக்கை")
TrebledJ
  • 8,713
  • 7
  • 26
  • 48
RaRaa
  • 31
  • 4
  • You need to use a font that support those characters. – Stop harming Monica Mar 26 '19 at 13:39
  • 1
    Related – [Non-ASCII Characters in Matplotlib](https://stackoverflow.com/questions/10960463/non-ascii-characters-in-matplotlib) – TrebledJ Mar 26 '19 at 13:47
  • 1
    @TrebledJ I tried all the methods listed in the link. But could not be able to resolve the problem. – RaRaa Mar 27 '19 at 03:11
  • @RaRaa Please show code (a [mcve]) that reproduces your problem. – TrebledJ Mar 27 '19 at 03:18
  • 1
    @TrebledJ `xx=['என்று', 'தான்', 'ஒரு', 'இந்த']` `yy=[1,3,2,5]` `import matplotlib.pyplot as plt` `plt.rc('font', family='Vijaya')` `plt.plot(xx,yy, 'go-')` `plt.xlabel("சொற்கள்")` `plt.ylabel("எண்ணிக்கை")` – RaRaa Mar 27 '19 at 06:28

0 Answers0