
我們可以將學到的圖表分為3類
sns.lineplot - Line Charts可以顯示時間和數據間的趨勢sns.barplot - Bar charts是可以比較不同column之間的數量sns.heatmap - Heatmaps可以將數據中的資料做顏色編碼sns.scatterplot - Scatter plots可以顯示兩個連續資料之間的關係,若加上顏色,則可以顯示類別數據sns.regplot - 在scatter plot中加上回歸線,可以更清楚的資料兩個資料間的關係sns.lmplot - 可以再scatter plot中加上多個回歸線sns.swarmplot - Categorical scatter plots顯示連續資料及類別資料之間的關係sns.displot - Histograms顯示單一數值變數的分布sns.kdeplot - ** KDE plots(or 2D KDE plots)**將質方圖變得更緩和sns.jointplot - 將兩個直方圖結合import pandas as pd
pd.plotting.register_matplotlib_converters()
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
print("Setup Complete")
Setup Complete
# Path of the file to read
spotify_filepath = "./spotify.csv"
# Read the file into a variable spotify_data
spotify_data = pd.read_csv(spotify_filepath, index_col="Date", parse_dates=True)
# Line chart
plt.figure(figsize=(12,6))
sns.lineplot(data=spotify_data)
<AxesSubplot:xlabel='Date'>

可以加上顏色讓圖表看起來比較不一樣
# Change the style of the figure to the "dark" theme
sns.set_style("dark")
# Line chart
plt.figure(figsize=(12,6))
sns.lineplot(data=spotify_data)
<AxesSubplot:xlabel='Date'>
