How can I make xticks of a plot in specific frequency? Here is my code:
# read data
df = pd.read_csv("newData/000001.csv")
df1 = df.loc[df['seqNo'] == 48]
df1 = df1.sort_values(by = 'date')
df1['date'] = df1['date'].astype(str)
# show plot
plt.plot(df1['date'], df1['close'], 'yellow', label = 'close')
plt.legend()
plt.xlabel("date")
plt.ylabel("value")
plt.title("000001")
plt.show()
and the plot, the x axis is too dense:
and the part of the plot is :
The datatype of xaxis is string.