matplotlib.pyplot.rc_context
-
matplotlib.pyplot.rc_context(rc=None, fname=None)[source] -
Возвращает контекстный менеджер для временного изменения rcParams.
Параметры: - rcdict
-
rcParams для временной установки.
- fnamestr или путь
-
Файл с настройками rc Matplotlib. Если заданы и fname, и rc, настройки из rc имеют приоритет.
См. также
Примеры
Передача явных значений через словарь:
with mpl.rc_context({'interactive': False}): fig, ax = plt.subplots() ax.plot(range(3), range(3)) fig.savefig('example.png') plt.close(fig)Загрузка настроек из файла:
with mpl.rc_context(fname='print.rc'): plt.plot(x, y) # uses 'print.rc'
Примеры использования matplotlib.pyplot.rc_context
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.4.3/api/_as_gen/matplotlib.pyplot.rc_context.html