title: Matplotlib: One X-Axis with two x labels of different type (int and string) in bar chart with one Y-Axis
body: <p>I am running through a problem on how to produce the attached image in <code>matplotlib</code>. I have <code>n</code> X-Axis (Users' most active minute) values in <code>x1</code> and corresponding <code>n</code> Y-axis (Count) values. I can do the bar chart using these two axes. However, I have another variable <code>Date</code> which I want in the upper X-Axis (<code>x2</code>) exactly like the attached image. The important point is both <code>x1</code> and <code>x2</code> is of same length and as you can see the datatype of <code>x1</code> is <code>int</code> and <code>x2</code>'s datatype is datetime(/string).</p>
  <p><code>x2</code> is <strong>NOT</strong> derived from <code>x1</code> and the <strong>position</strong> of both the ticks and labels of <code>x1</code> and <code>x2</code> would be same. In brief, you can say X-Axis having two different labels with same Y-Axis. Any help would be greatly appreciated. Also, I would like to have the Y-Axis <code>Count</code> in the middle of each bar.</p>
  <p><strong>P.S:</strong> It would be nice if generic answer is provided as I have more than 5 datapoints unlike the attached image. So, <strong>I need a solution for n number of x1, n number of x2, and n number of Y values</strong>. Thank you!</p>
  <p><a href="https://i.stack.imgur.com/Tpvsz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tpvsz.png" alt="This is what I am looking for" /></a></p>