qbstyles
dark和light
:Matplotlib-rcParams及绘图风格(style)设置详解
Matplotlib绘图主题(plt.style)大全
Seaborn图形外观设置
import numpy as np
import matplotlib.pyplot as plt
#调用qbstyles
from qbstyles import mpl_style
mpl_style(dark=False) #开启light主题
plt.figure(dpi=110)
#数据准备
def f(t):
return np.exp(-t) * np.cos(2 * np.pi * t)
t = np.arange(0.0, 5.0, 0.1)
#绘图
plt.plot(t, f(t))
plt.show()
import numpy as np
import matplotlib.pyplot as plt
#调用qbstyles
from qbstyles import mpl_style
mpl_style(dark=True) #开启dark主题
plt.figure(dpi=110)
#数据准备
def f(t):
return np.exp(-t) * np.cos(2 * np.pi * t)
t = np.arange(0.0, 5.0, 0.1)
#绘图
plt.plot(t, f(t))
plt.show()
相比Matplotlib默认图,美观不少~
pip install qbstyles
ref: https://github.com/quantumblacklabs/qbstyles
-推荐阅读-
-END-
关注Pythonic生物人 |