You can specify xtick loactions in a command xticks. So in your case, this should do the trick: instead
plt.xticks(rotation = '25')
use
plt.xticks(dates,rotation = '25')
Here's a minimal working example that illustrates your question and fix.
import numpy as np
import matplotlib.pyplot as plt
x = [1.0, 2.0, 3.0, 4.0, 5.0]
y = np.random.rand(2,5)
fig = plt.figure()
ax = plt.subplot(1,1,1)
bar1 = ax.bar(x, y[0,:], color='darkgray', width=0.5, linewidth=0, alpha=0.5)
bar2 = ax.bar(x, y[1,:], color = 'blue', width=0.5, linewidth=0, alpha=0.45)
plt.xticks(rotation = '25')
plt.show()
This will result in the following figure:

, , - , , .
, plt.xticks ( ), :

, y- (- np.random, . , x- , x.
, numpy arange. arange, linspace, ( ). plt.xticks(x,rotation='25') :
names = ['one', 'two', 'three', 'four', 'five']
x_tick_location = np.arange(np.min(x),np.max(x)+0.001,2.0)
x_tick_labels = [names[x.index(xi)] for xi in x_tick_location]
plt.xticks(x_tick_location,x_tick_labels,rotation = '25')
:

, :
names, , . , , . xticks.np.arange, . min max x 2. max, , ( ).[names[x.index(xi)] for xi in x_tick_location] , x_tick_location, x names.- , ,
xticks.