Please enable JavaScript.
Coggle requires JavaScript to display documents.
Matplotlib (from matplotlib import pyplot as plt) (plot(折線圖) (ax=plt…
Matplotlib (from matplotlib import pyplot as plt)
plot(折線圖)
plt.plot(figsize=(w,h),
colors=red/'#HEX',
labels='for showing on legend')
ax=plt.subplot(rows, cols, index)
ax.set_xticks()
ax.set_yticks()
ax.set_xticklabels()
ax.set_yticklabels()
plt.title('I am title')
plt.savefig('figure.png')
plt.show()
Bar Chart
plt.bar(range(len(
list
)),
list
)
side by side bar char
the position of x-ticks have to be computed!
Stack Bar Char
Error bars
Fill Between
shaded error
plt.fill_between(
x_values, y_lower, y_upper, alpha=0.2
)
Pie Chart
plt.bar(
list
)
plt.axis('equal')
x-y 軸等長
Histogram
plt.hist(
dataset, range=(66,69), bins=40
)
透過 alpha, histtype的設置,能將histogram顯示的更好
plt.hist(b, range=(55, 75), bins=20,
alpha=0.4,histtype='step'
)
KDE Plot
sns.kdeplot(data=df, x='col_name1', y='col_name2')
Bar plot
sns.barplot(data=df, x='col_name1', y='col_name2')
Box Plot
sns.boxplot(data=df, x='col_name1', y='col_name2')
hue: 在同一個x項目中,顯示其他特性的比較
split: 其他特性的數據,是否分開。
hue = 'col_name'
split = True/False