I am trying to plot two histograms with the same date in x-axis. The graph shows date in x-axis right, but failed to show data.
This is the code I used,
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
#makes the data
y1 = np.array([123, 456, 789, 10, 5, 123, 456, 789, 10, 5])
y2 = np.array([123, 456, 789, 100, 5, 123, 456, 789, 10, 5])
colors = ['b','g']
#plots the histogram
fig, ax1 = plt.subplots()
ax1.hist([y1,y2],color=colors)
datemin = datetime.strptime('2018-01-01', '%Y-%m-%d')
datemax = datetime.strptime('2018-01-10', '%Y-%m-%d')
ax1.set_xlim(datemin, datemax)
ax1.set_ylabel("Count")
plt.tight_layout()
plt.show()