1

example

How do I hide the 32. and Jun, 14 2020 tickers that are not getting used. They don't exist in the data I provided.

I'm setting locators like this:

plt.gca().xaxis.set_major_locator(DayLocator())
plt.gca().yaxis.set_major_locator(MultipleLocator(1))
Zephyr
  • 11,891
  • 53
  • 45
  • 80
Maxxik CZ
  • 314
  • 2
  • 9

1 Answers1

2

For the y axis you should use:

plt.gca().set_ylim([27, 31])

The same for the x axis, but you should use the date format. Can you provide the line of code where you do the plot? As an example, if your x axis data are located in a 'Date' column of a df dataframe, you could use:

plt.gca().set_xlim([df['Date'].iloc[0], df['Date'].iloc[-1]])
Zephyr
  • 11,891
  • 53
  • 45
  • 80