import matplotlib.pyplot as plt
import numpy as np
For default style, you can modify it by creating mpl_configdir/stylelib, where mpl_configdir can be obtained by
import matplotlib as mpl
mpl.get_configdir()
Then, you can create a style file with the extension name of .mplstyle (mod_default.mplstyle here). Here is an example
font.family : Arial
axes.titlesize : 16
axes.labelsize : 16
lines.linewidth : 1
lines.markersize : 10
xtick.labelsize : 16
ytick.labelsize : 16
axes.grid : True
xtick.minor.visible : True
ytick.minor.visible : True
legend.fontsize : 14
After creating the style file, you need to reload the library and check
plt.style.reload_library()
print(plt.style.available)
Here is some references for existing styles ( https://matplotlib.org/gallery/style_sheets/style_sheets_reference.html )
Since this style file is not a complete one but just to modify some parameters, you still need the default one and replace some parameters using this style file.
plt.style.use(['default','mod_default'])