Skip to content

Instantly share code, notes, and snippets.

@lawrencechen0921
Created August 11, 2019 07:24
Show Gist options
  • Save lawrencechen0921/b848dd9ba6b9b92e40c947dd6de57016 to your computer and use it in GitHub Desktop.
Save lawrencechen0921/b848dd9ba6b9b92e40c947dd6de57016 to your computer and use it in GitHub Desktop.
教大家如何用matplotlib第三方模組將數值轉換成圖片
#首先你必須用 pip install matplotlib
#等他下載完成,你就可以使用模組去進行數據視覺化的動作
import matplotlib.pyplot as plt
data=[5,10,15,25,20] #把你需要的data數值用出來
plt.barh(range(len(data)),data) #圖片會顯示你data長度和範圍
plt.show()
#是不是很簡單呀
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment