title: Matplotlib Xticks Values in Bar Chart
body: <p>I have this code and im trying to make a graph. All values are in the lists are correct. However, i have problem in x axis. First, there is a gap between first two ticks. I read all matplotlib in their site but couldn find anyting useful for this problem. I'm all confused about xticks function. <a href="https://i.stack.imgur.com/PqTsC.png" rel="noreferrer">This is my graph</a></p>
  
  <pre><code>plt.bar(Valloc1,[diabete[w] for w in sorted(diabete.keys())], width=0.2,)
  
  plt.bar(Valloc2,[not_diabete[w] for w in sorted(not_diabete.keys())], width=0.1, )
  
  plt.xticks(all_years, rotation = '65')
  plt.legend(['Diabete','Not-Diabete'])
  plt.xlabel('Years')
  plt.ylabel('# of patients')
  plt.legend()
  plt.show()
  </code></pre>
  
  <p>I have tried this line but everything went worse.</p>
  
  <pre><code>plt.xticks(range(all_years),all_years, rotation = '65')
  </code></pre>
  
  <p>I also want that two bars to be beside not overlap. Just like this :
  <a href="https://i.stack.imgur.com/lOFbE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lOFbE.png" alt="Bars side-by-side"></a>
  <a href="https://i.stack.imgur.com/lOFbE.png" rel="noreferrer">Bars side-by-side</a></p>
  
  <p>My variables are:</p>
  
  <pre><code>Valloc1 = [i for i in range(52)]
  diabete = {{1967: 5, 1986: 13, 1985: 9, 1996: 5, 1984: 10, 1987: 6, 1991: 8...}
  </code></pre>