plotting a graph but manully changing xticks labels
plt.plot(range(df.shape[0]), (df['Low'] + df['High']) / 2.0)
plt.xticks( range(0,df.shape[0],500),df['Date'].loc[::500], rotation=45)
plt.xlabel('Date', fontsize=18)
plt.ylabel('Mid Price', fontsize=18)
plt.title(label="Year wise data", fontsize=40,
color="green")
# print("shape",df.shape[0])
# print(range(0, df.shape[0], 500))
print( df['Date'].loc[500:])
# print(range(10000, df.shape[0],500), df['Date'].loc[::500])
# print(range(10000,df.shape[0],500))
plt.show()
this part of code will plot a graph which consists of data from the year 1962 to 2014(14,000 lines)
something like this
but i just want to change the xticks to show the values from 13,000 line to the last one but when i tried to change the range
range(13000,df.shape[0],500)
which is supposed to get values from 13000 to 14000 with 500 interval but instead im getting error
The number of FixedLocator locations (3), usually from a call to set_ticks, does not match the number of ticklabels (29).
or something similar if i change the values
i have tried to change location or value through here but it is of no use
df['Date'].loc[::500]
is there anyway where we can manually add xticks irrespective of the data at that location