8000 Unicode invisible after image saved · Issue #6326 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Unicode invisible after image saved #6326
@sumomoshinqi

Description

@sumomoshinqi

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.
2016-04-23 11 18 12
figure_1
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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0