import pandas as pd
import matplotlib.pyplot as plt
df3 = pd.read_csv('df3')
%matplotlib inline

df3.info()

df3.head()

"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>

Pandas Data Visualization Exercise
This is just a quick exercise for you to review the various plots we showed earlier. Use df3 to replicate the following plots.
End of explanation
"""


df3.plot.scatter(x='a',y='b',c='red',s=50,figsize=(12,3))

"""
Explanation: Recreate this scatter plot of b vs a. Note the color and size of the points. Also note the figure size. See if you can figure out how to stretch it in a similar fashion. Remeber back to your matplotlib lecture...
End of explanation
"""


df3['a'].plot.hist()

"""
Explanation: Create a histogram of the 'a' column.
End of explanation
"""


plt.style.use('ggplot')

df3['a'].plot.hist(alpha=0.5,bins=25)

"""
Explanation: These plots are okay, but they don't look very polished. Use style sheets to set the style to 'ggplot' and redo the histogram from above. Also figure out how to add more bins to it.*
End of explanation
"""


df3[['a','b']].plot.box()

"""
Explanation: Create a boxplot comparing the a and b columns.
End of explanation
"""


df3['d'].plot.kde()

"""
Explanation: Create a kde plot of the 'd' column
End of explanation
"""


df3['d'].plot.density(lw=5,ls='--')

"""
Explanation: Figure out how to increase the linewidth and make the linestyle dashed. (Note: You would usually not dash a kde plot line)
End of explanation
"""


df3.ix[0:30].plot.area(alpha=0.4)

"""
Explanation: Create an area plot of all the columns for just the rows up to 30. (hint: use .ix).
End of explanation
"""


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()

"""
Explanation: Bonus Challenge!
Note, you may find this really hard, reference the solutions if you can't figure it out!
 Notice how the legend in our previous figure overlapped some of actual diagram. Can you figure out how to display the legend outside of the plot as shown below?
 Try searching Google for a good stackoverflow link on this topic. If you can't find it on your own - use this one for a hint.
End of explanation
"""


