加入座標軸標籤與標題
為圖表加入標籤很重要,這能讓其他人清楚了解它想傳達的資訊。 在這個練習中,你會替上一題所建立的圖表加入標籤。
本練習屬於課程
Python 金融入門
練習說明
- 加入以下標籤:
- x 軸:
'Days' - y 軸:
'Prices, $' - 標題:
'Company Stock Prices Over Time'
- x 軸:
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
import matplotlib.pyplot as plt
# Plot price as a function of time
plt.plot(days, prices, color="red", linestyle="--")
# Add x and y labels
____('Days')
____('Prices, $')
# Add plot title
____('Company Stock Prices Over Time')
# Show plot
plt.show()