title: hide histogram output of matplotlib
body: <p>How would I hide the output of <code>plt.hist()</code> when also trying to plot its top curve?</p>
  
  <pre><code>data = {'first': np.random.normal(size=[100]),
          'second': np.random.normal(size=[100]),
          'third': np.random.normal(size=[100])}
  
  for data_set, values in sorted(data.items()):
      y_values, bin_edges, _ = plt.hist(values, bins=20)
      bin_centers = 0.5*(bin_edges[1:] + bin_edges[:-1])
      plt.plot(bin_centers, y_values, '-', label=data_set)
  
  legend = plt.legend()
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Ok145.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ok145.png" alt="enter image description here"></a></p>
  
  <p>similar question, but I can't just clear the plot since there's a loop.
  <a href="https://stackoverflow.com/questions/40647396/hide-histogram-plot">Hide histogram plot</a></p>