Introduction to Linear Modeling in Python
Jason Vestuto
Data Scientist
import matplotlib.pyplot as plt
plt.plot(x, y, 'r-o')
plt.show()

# Import the pyplot module
import matplotlib.pyplot as plt
# Create figure and axis objects
fig, axis = plt.subplots()
# Prepare initial style options
options = dict(marker='o', color='blue')
# Call the plot method on the axis object
line = axis.plot(x, y, **options)
# Modify the axis object with set methods
_ = axis.set_ylabel('Times')
_ = axis.set_xlabel('Distances')
# Display figure
plt.show()
(x1,y1) = (0,0)(x2,y2) = (2,3)dy = (y2 - y1) = 3 - 0dx = (x2 - x1) = 2 - 0slope = dy/dx = 3/2x=0: y1 = 0
Introduction to Linear Modeling in Python