我已经使用我在 excel 上的数据绘制了一个图表,并且有 x 和 y 轴的值。但是,我想通过仅显示仅反映轴上关键日期的特定值来更改 x 轴上的值。那可能吗?
这是我写的代码:
import pandas as pd
from matplotlib import pyplot as plt #download matplot library
#create a graph of the cryptocurrencies in excel
btc = pd.read_excel('/Users/User/Desktop/bitcoin_prices.xlsx')
btc.set_index('Date', inplace=True) #Chart Fit
btc.plot()
plt.xlabel('Date', fontsize= 12)
plt.ylabel('Price ($)', fontsize= 12)
plt.title('Cryptocurrency Prices', fontsize=15)
plt.figure(figsize=(60,40))
plt.show() #plot then show the file
谢谢你。