title: creating histogram from 2d array python
body: <p>Currently I have a matrix of 1's, 0's, and -1's where each row is a person and each column is a bill that they voted on. The 1's, 0's, and -1's in each cell denote how they voted.</p>
  
  <p>The histogram I am trying to build would show the number of people with x amount of yes votes (the number of rows with x amount of 1's) on the Y axis. On the X axis it would have ticks 0-N yes votes. So for example, if 30 people voted yes, the bar at the 30 label on the X axis would go up to 30 on the Y axis.</p>
  
  <p>Here is a screenshot of these histograms that I quickly made in MatLab(where my experience which such things is): <img src="https://i.stack.imgur.com/d0OUf.png" alt="histograms built in MatLab"></p>
  
  <p>My question is how to easily and effectively do this in Python. I have very little experience with Python. </p>
  
  <p>The code I have: </p>
  
  <pre><code>def buildHistogram(matrix):
      plt.hist(matrix, bins = 30)
      plt.show()
  </code></pre>
  
  <p>Which yields: <img src="https://i.stack.imgur.com/4qtnI.png" alt="histograms built in Python"></p>
  
  <p>Please let me know how I can split these into three different histograms. Do I need to make three different arrays?</p>