In [37]:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df3 = pd.read_csv('df3')
%matplotlib inline
In [2]:
df3.info()
In [3]:
df3.head()
Out[3]:
Create scatter plot of b vs a
In [8]:
df3.plot.scatter(x='b', y='a', figsize=(12,3), color='red')
Out[8]:
Create a histogram of the 'a' column.
In [9]:
df3['a'].hist()
Out[9]:
Using style sheets to set the style to 'ggplot'
In [13]:
plt.style.use('ggplot')
df3['a'].plot.hist(bins=30)
Out[13]:
Create a boxplot comparing the a and b columns.
In [25]:
df3[['a', 'b']].plot.box()
Out[25]:
Create a kde plot of the 'd' column
In [26]:
df3['d'].plot.kde()
Out[26]:
Increase the linewidth and make the linestyle dashed
In [29]:
df3['d'].plot.kde(lw=5, ls='--')
Out[29]:
Create an area plot of all the columns for just the rows up to 30
In [40]:
df3.ix[0:30].plot.area(alpha=0.4)
Out[40]:
Displaying the legend outside the plot frame
In [49]:
f = plt.figure()
df3.ix[0:30].plot.area(alpha=0.4, ax=f.gca())
plt.legend(loc='center left', bbox_to_anchor=(1.0, 0.5))
plt.show()