1

I'm working on reading some photos and taking the text with OCR. Now I need to rank the text read into some graph in order to see some pattern. But when I try to plot those texts into a graph, I got blank squares in the place of some characters. I'm sharing a example of what I've done with a script:

This is an example script:

import numpy as np
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
y = [0,1,2,3]
group_labels = ['77 7 7 7\r\nlfISldI\r\n\r\n',
                'G217\r\nini\r\n\r\n', 
                'L519\r\nini\r\n\r\n',
                'QED\r\n\r\n']

ax.set_yticks(y)
ax.tick_params(axis='both', which='major', labelsize=15)
ax.set_yticklabels(group_labels, minor=False)

plt.show()

This is the graph it generates:

Jupyter notebook output

My goal is that the graph plotted has the same text as written in the 'group_labels' list.

1
  • Matplotlib cannot interprete \r\n . You can replace every occurence of \r\n with \n. Commented Jul 5, 2019 at 20:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.