发布时间:2023-03-30 12:30
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
#查看所有风格
plt.style.available
[\'bmh\', \'classic\', \'dark_background\', \'fast\', \'fivethirtyeight\', \'ggplot\', \'grayscale\', \'seaborn-bright\', \'seaborn-colorblind\', \'seaborn-dark-palette\', \'seaborn-dark\', \'seaborn-darkgrid\', \'seaborn-deep\', \'seaborn-muted\', \'seaborn-notebook\', \'seaborn-paper\', \'seaborn-pastel\', \'seaborn-poster\', \'seaborn-talk\', \'seaborn-ticks\', \'seaborn-white\', \'seaborn-whitegrid\', \'seaborn\', \'Solarize_Light2\', \'tableau-colorblind10\', \'_classic_test\']
#构造数据
x = np.linspace(-10,10)
y = np.sin(x)
plt.plot(x,y)
[]
#更换风格
plt.style.use(\'dark_background\')
#再次绘图
plt.plot(x,y)
[]
plt.xkcd()
#再次绘图
plt.plot(x,y)
[]