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)
[<matplotlib.lines.Line2D at 0x668f940>]

41.Matplotlib风格

#更换风格
plt.style.use('dark_background')
#再次绘图
plt.plot(x,y)
[<matplotlib.lines.Line2D at 0x68d5ac8>]

41.Matplotlib风格

plt.xkcd()
#再次绘图
plt.plot(x,y)
[<matplotlib.lines.Line2D at 0x522d400>]

41.Matplotlib风格

相关文章:

  • 2021-04-13
  • 2021-09-21
  • 2021-11-06
  • 2021-09-14
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
猜你喜欢
  • 2021-11-03
  • 2022-12-23
  • 2021-06-19
  • 2021-07-05
  • 2021-08-19
  • 2021-11-11
  • 2021-07-09
相关资源
相似解决方案