This warning message is usually encountered when trying to plot or display text that contains a character that is not available in the current font being used. In this specific case, the missing glyph is identified by its Unicode code point, which is 28857.

To resolve this issue, you can either choose a different font that supports the missing glyph or install a font that includes the missing character. You can also try to replace the missing character with a similar one that is available in the current font.

Here's an example of changing the font to resolve this warning message:

import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "Arial Unicode MS" # Use a font that supports the missing glyph
plt.text(0.5, 0.5, 'Missing character: \u28857')
plt.show()

This code sets the font family to "Arial Unicode MS", which is known to support a wide range of Unicode characters, including the missing glyph with code point 28857. The text is then displayed without any warning messages

RuntimeWarning Glyph 28857 missing from current font fontset_texts 00 flags=flags

原文地址: https://www.cveoy.top/t/topic/g1AQ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录