# 1.pandas 窗口函数,三角窗
```python
import pandas as pd
import numpy as np
%matplotlib inline
df = pd.DataFrame({'B': [0, 1, 2, 1, 4,2,3,0]})
df['windows']=df.rolling(2, win_type='triang').sum()
df.plot(style='o-',figsize=(10,5));
```

# 2.核密度图
```python
df4 = pd.DataFrame({'a': np.random.randn(1000) + 1, 'b': np.random.randn(1000),
'c': np.random.randn(1000) - 1}, columns=['a', 'b', 'c'])
df4.head()
ax = df4[['a']].plot(kind='hist')
df4[['a']].plot(kind='kde', ax=ax, secondary_y=True)
```

# 3.热力图
```python
df = pd.DataFrame(np.random.randn(1000, 2), columns=['a', 'b'])
df['b'] = df['b'] + np.arange(1000)
df.plot.hexbin(x='a', y='b', gridsize=25,figsize=(20,10))
```

# 4.散点图
```python
df = pd.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1],
[6.4, 3.2, 1], [5.9, 3.0, 2]],
columns=['length', 'width', 'species'])
print(df)
ax2 = df.plot.scatter(x='length',
y='width',
c='species',
colormap='viridis')
```

# 5.柱形图
```sql
df = pd.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1],
[6.4, 3.2, 1], [5.9, 3.0, 2]],
columns=['length', 'width', 'species'])
print(df)
df.plot.bar()
df.plot.bar(stacked=1)
```


# 6.条形图
```python
df = pd.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1],
[6.4, 3.2, 1], [5.9, 3.0, 2]],
columns=['length', 'width', 'species'])
print(df)
df.plot.bar()
df.plot.bar(stacked=1)
df.plot.barh(stacked=True);
```

# 7.箱子图
```python
df = pd.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1],
[6.4, 3.2, 1], [5.9, 3.0, 2]],
columns=['length', 'width', 'species'])
print(df)
df.plot.box()
```
