答案 0 :(得分:0)
试试这个:
import matplotlib.pyplot as plt
import numpy as np
# Data
x = np.array([0,15,30,45,60,75,90]) # Days
y = np.array([20,25,21,22,23,20,29]) # Temperature
# Labels
first_day_of_month = np.array([0,31,59,89]) # First day of each month
my_xticks = ['January','February','March','April']
plt.xticks(first_day_of_month, my_xticks)
#Plot
plt.plot(x, y)
plt.show()