Introductie tot lineaire modellering in Python
Jason Vestuto
Data Scientist
import matplotlib.pyplot as plt
plt.plot(x, y, 'r-o')
plt.show()

# Importeer de module pyplot
import matplotlib.pyplot as plt
# Maak figure- en as-objecten
fig, axis = plt.subplots()
# Voorbereiden van beginstijlen
options = dict(marker='o', color='blue')
# Roep de plot-methode aan op het as-object
line = axis.plot(x, y, **options)
# Pas het as-object aan met set-methodes
_ = axis.set_ylabel('Times')
_ = axis.set_xlabel('Distances')
# Figuur tonen
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
Introductie tot lineaire modellering in Python