-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Description
OSX 10.11.4, Python 2.7.10, Matplotlib 1.3.1
Unicode characters were displayed correctly in the figure. But after saving, they went disappeared.
I was making a nltk like dispersion plot for Unicode text.
def dispersion_plot(text, words, title="Lexical Dispersion Plot"):
points = [(x,y) for x in range(len(text))
for y in range(len(words))
if text[x].encode('utf8') == words[y].encode('utf8')]
if points:
x, y = list(zip(*points))
else:
x = y = ()
pylab.plot(x, y, "b|", scalex=.1)
pylab.yticks(list(range(len(words))), words, color="b")
pylab.ylim(-1, len(words))
pylab.title(title)
pylab.xlabel("Word Offset")
pylab.show()
Metadata
Metadata
Assignees
Labels
No labels