I need to set a specific tick label on a certain tick position, while deleting preexisting labels.
Specifically, The labels on the x axis are dates for the value of a stock, and I want to delete those and set one for each month instead.
Date Open High Low Close/Price Volume 6/24/2019 86.78 87.11 86.06 86.55 1507828 6/25/2019 86.63 87.23 84.81 85.06 2481284 6/26/2019 85.38 85.81 84.75 85.33 2034693 6/27/2019 85.65 86.86 85.13 86.43 1394847 6/28/2019 86.66 87.74 86.66 87.55 3025379 7/1/2019 88.84 89.72 87.77 88.45 4017249 7/2/2019 89.21 90 87.95 88.87 2237183 7/3/2019 89.14 91.08 89.14 90.67 1647124
import pandas as pd
import matplotlib.pyplot as plt
def main():
df = pd.read_excel('DatosUnited.xlsx')
date = df['Date']
closePrice = df['Close/Price']
plt.xlabel('Tiempo')
plt.ylabel('Valor de las acciones (USD) ')
plt.title('Este mes')
plt.plot(date,closePrice,'r')
plt.show()
main()
I tried to delete all the tick labels, and set a list of new ones, but failed to set them in the desired position