title: Plot histogram bins only if count is above a threshold
body: <p>Let's say I have a vector like this:</p>
  
  <pre><code>mydata = c(1, 3, 4, 5, 6, 7, 8, 9, 10)
  </code></pre>
  
  <p>A five-break histogram would look like this:</p>
  
  <pre><code>h = hist(mydata, breaks=5)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/2QiDZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2QiDZ.png" alt="enter image description here"></a></p>
  
  <p>How can I plot only the bins whose frequency count is above a threshold? In this case, any count greater than 1.</p>
  
  <p>I would like to end up with the following histogram:</p>
  
  <p><a href="https://i.stack.imgur.com/lW4i1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lW4i1.png" alt="enter image description here"></a></p>
  
  <p>I know I can access the counts and breaks with <code>h$counts</code> and <code>h$breaks</code> but I cannot think of a simple way to use these to filter out some bins.</p>