Skip to content

characters argument and plt.savefig#17

Description

@SG-phimeca

There seem to be a problem when saving figures as pdf with matplotlib.pyplot.savefig and using the characters argument in Waffle: some characters are replaced by others.

list_character = ["馃柍", "馃悕"]

from pywaffle import Waffle
from matplotlib import pyplot as plt

n_row = 4
n_column = 5

import numpy as np
list_value = np.ones(len(list_character))

fig = plt.figure(
    FigureClass=Waffle,
    rows=1,
    columns=len(list_character),
    values=list_value,
    characters=list_character,
    font_file="~/.fonts/Symbola.ttf",
    font_size=50
    )

plt.savefig("replaced_character.pdf")
plt.close("all")

yields the attached file (two snakes instead of a computer and a snake).
The computer alone is correctly printed. Inverting the order yields two snakes.

replaced_character.pdf

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions