41.Matplotlib风格

发布时间: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)
[]

\"41.Matplotlib风格_第1张图片\"

#更换风格
plt.style.use(\'dark_background\')
#再次绘图
plt.plot(x,y)
[]

\"41.Matplotlib风格_第2张图片\"

plt.xkcd()
#再次绘图
plt.plot(x,y)
[]

\"41.Matplotlib风格_第3张图片\"

ItVuer - 免责声明 - 关于我们 - 联系我们

本网站信息来源于互联网,如有侵权请联系:561261067@qq.com

桂ICP备16001015号