def reset_matplotlib():
"""
Reset matplotlib to a common default.
"""
# Set all default values.
mpl.rcdefaults()
# Force agg backend.
plt.switch_backend('agg')
# These settings must be hardcoded for running the comparision tests and
# are not necessarily the default values.
mpl.rcParams['font.family'] = 'Bitstream Vera Sans'
mpl.rcParams['text.hinting'] = False
# Not available for all matplotlib versions.
try:
mpl.rcParams['text.hinting_factor'] = 8
except KeyError:
pass
import locale
locale.setlocale(locale.LC_ALL, str('en_US.UTF-8'))
# Most generic way to get the data folder path.
评论列表
文章目录