pyaf icon indicating copy to clipboard operation
pyaf copied to clipboard

Fix unicode font issues with matplotlib

Open antoinecarme opened this issue 6 years ago • 2 comments

Following #76, PyAF plot contain empty boxes instead of unicode "characters".

image

antoinecarme avatar Nov 19 '17 10:11 antoinecarme

need t o find a way to force matplotlib to use a valid unicode font.

antoinecarme avatar Nov 19 '17 10:11 antoinecarme

https://github.com/matplotlib/matplotlib/pull/20740

image

antoinecarme avatar May 25 '22 16:05 antoinecarme

According to matplotlib issues wiht unicode, the default font families have to be defined before any kind of plotting.

the following code before building any pyaf model solves the unicode issues when plotting the time series (choose your favorite fonts, here are mine for chinese)

import matplotlib.pyplot as plt
plt.rcParams['font.family'] = ['Segoe UI Emoji', 'SimHei']

antoinecarme avatar Feb 02 '23 17:02 antoinecarme

image

antoinecarme avatar Feb 02 '23 17:02 antoinecarme

FIXED.

antoinecarme avatar Feb 02 '23 17:02 antoinecarme