currently my x tick label is the index but I need it to be a column, when I try to change it, the values are compressed in an area of the graph
[graph]
my code:
x = df_num['Date'].tolist()
plt.figure(figsize=(16, 6))
fig.tight_layout()
plt.plot(df_num[target_feature])
plt.xlabel("X-Axis")
plt.ylabel("Y-Axis")
plt.title("Set X labels in Matplotlib Plot")
plt.xticks(x)
plt.figure(figsize=(16, 6))
plt.show()
thanks for your answers, i found the right one:
x = df_num['Date'].tolist()
labels = []
ticks = []
for i in range(0, len(x), 5000):
#print(x[i])
ticks.append(i)
labels.append(x[i])
plt.figure(figsize=(16, 6))
fig.tight_layout()
plt.plot(df_num[target_feature])
#plt.xlabel("X-Axis")
#plt.ylabel("Y-Axis")
plt.title(target_feature)
plt.xticks(ticks=ticks, labels=np.array(labels))
#plt.xticks(np.arange(0, 130825, step=5000))
plt.xticks(rotation=90)
plt.show()