title: How to use bin edges at the x-axis of a histogram?
body: <p>I'm rather new with regard to Matplotlib which want to use for making (multiple) histograms of data counts with float intervals on the x-axis in a tkinter toplevel window. See below a highly simplified part of my code. Because I use float intervals, I need to apply a ax2.hist(...) call in stead of the ax1.bar(...) call. See my code below. However, the result from ax2.hist(...) is not what I want. I would like tot have the counts at the y-axis as is the case in ax1. With other words, how do I get a histogram with y-axis from ax1 and the x-axis from ax2?
  I hope somebody can suggest how to deal with this. I couldn't find it on the matplotlib site, sofar.</p>
  <pre><code>import tkinter as tk
  import matplotlib.pyplot as plt
  from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
  import numpy as np
  import random
  
  root = tk.Tk()
  panel = tk.Toplevel()
  panel.title('Title')
  
  lijst = []
  for i in range(100):
      a = random.randrange(100)
      a=a/10
      lijst.append(a)
  nplijst = np.array(lijst)
  counts, bins = np.histogram(nplijst)
  
  names = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h' ,'i', 'j']
  print(counts)
  print(bins)[![resulting ax1 bar graph and ax2 histogram][1]][1]
  fig1 = plt.Figure()
  ax1 = fig1.add_subplot(121)
  ax2 = fig1.add_subplot(122)
  ax1.bar(names, counts, width = 1, edgecolor=&quot;k&quot;)
  ax2.hist(counts, bins = bins, edgecolor=&quot;k&quot;)
  ax1.set_title('ax1')
  ax2.set_title('ax2')
  
  chart_type1 = FigureCanvasTkAgg(fig1, panel)
  chart_type1.get_tk_widget().pack()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/LaVZK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LaVZK.jpg" alt="enter image description here" /></a></p>