Veriyi Görselleştirme
Python'da her şey, modüller bile, bir nesnedir. Bu egzersizde hedefin, ölçülen verileri daha esnek ve genişletilebilir bir iş akışında görselleştirmek için matplotlib kütüphanesinin nesne yönelimli arayüzlerinin kullanımını gözden geçirmek. Genel çizim iş akışı şöyle görünür:
import matplotlib.pyplot as plt
fig, axis = plt.subplots()
axis.plot(x, y, color="green", linestyle="--", marker="s")
plt.show()

Bu egzersiz, kursun bir parçasıdır
Python ile Doğrusal Modellemenin Temelleri
Egzersiz talimatları
plt.subplots()kullanarak figure ve axis nesnelerini oluştur.- Veriler, önceden tanımlanmış iki
numpydizisinde sağlandı:timesvedistances. axis.plot()kullanarak yatay eksenetimes, dikey eksenedistancesçiz.axis.plot()çağırırken şu anahtar sözcük argümanlarını kullan:linestyle=" ",marker="o"vecolor="red".
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
# Create figure and axis objects using subplots()
fig, axis = plt.____()
# Plot line using the axis.plot() method
line = axis.plot(____ , ____ , linestyle="____", marker="____", color="____")
# Use the plt.show() method to display the figure
plt.____()