Closed
Description
Bug report
Bug summary
matplotlib.rc_file
reverts to the default template before updating rcparams.
Code for reproduction
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.style.use("seaborn-darkgrid")
mpl.rc_file('mpl_style.txt')
plt.plot(1)
where mpl_style.txt
contains
font.size : 28
Expected outcome
If instead we swap the order of the commands (first we update the rcfile and then we apply the style) then it works.
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rc_file('mpl_style.txt')
plt.style.use("seaborn-darkgrid")
plt.plot(1)
The workaround, right now, is to use matplotlib.rcParams.update(matplotlib.rc_params_from_file('mpl_style.txt', use_default_template=False))
. I guess an option like use_default_template=False
should be included in matplotlib.rc_file
as well.
Matplotlib version
- Operating system: Windows 10
- Matplotlib version: matplotlib 3.0.2 (conda)
- Matplotlib backend (
print(matplotlib.get_backend())
): TkAgg - Python version: 3.6.6
Metadata
Metadata
Assignees
Labels
No labels