<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Watch Me Code 1
Step1:  Manual Plotting in Matplotlib
Step2:  Plotting chart types
Step3:  Plotting with Pandas
<ASSISTANT_TASK:>
Python Code:
# Jupyter Directive
%matplotlib inline 
# imports
import matplotlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
matplotlib.rcParams['figure.figsize'] = (20.0, 10.0) # larger figure size
Explanation: Watch Me Code 1: Matplotlib
We will demonstrate Pythons data visualization library Matplotlib using it two ways
Standalone
With Pandas
End of explanation
# Matplotlib requires lists to plot
x = [1,2,3,4,5]
xsquared = [1,4,9,16,25]
plt.plot(x,xsquared) # default is a blue line
# this can be overridden. consult help(plt.plot) for details
#MATLAB MATPLOTLIB
plt.plot(x, xsquared, 'ro') # red dots
# we can manipulate the axis too, rather than auto scale. In this case we must call plt.show() to display the plot
plt.plot(x, xsquared, 'ro') # red dots
plt.axis([0,6,0,26]) # a list in the form [xmin, xmax, ymin, ymax]
plt.show()
# Labels are simple
plt.bar(x, xsquared) #,'r--') # red dashes
plt.axis([0,6,0,26]) # a list in the form [xmin, xmax, ymin, ymax]
plt.xlabel("Value of X", fontsize=36)
plt.ylabel("Value of X Squared", fontsize=36)
plt.title("Plot of X versus X Squared", fontsize=48)
plt.grid(True)
plt.show()
Explanation: Manual Plotting in Matplotlib
End of explanation
plt.bar(x,xsquared)
plt.pie(x)
plt.scatter(x, xsquared)
Explanation: Plotting chart types
End of explanation
scores = pd.read_csv("https://raw.githubusercontent.com/mafudge/datasets/master/exam-scores/exam-scores.csv")
scores.sample(10)
# Plotting with Pandas is a bit more expressive
scores.plot.scatter(x ='Completion_Time', y ='Student_Score' )
scores.corr()
## Labels too small, we can fall back to Matplot lib!
p = scores.plot.scatter(x ='Completion Time', y ='Student Score', fontsize=20)
p.set_xlabel('Completetion Time', fontsize=20)
p.set_ylabel('Student Score', fontsize=20)
p
# Take the value counts of letter grade and create a data frame
letter_grades = pd.DataFrame( { 'Letter' : scores['Letter_Grade'].value_counts() } ).sort_index()
letter_grades.plot.bar(sort_columns=True)
letter_grades.plot.pie( y = 'Letter', fontsize = 20)
Explanation: Plotting with Pandas
End of explanation
<END_TASK>