title: How to label geom_bar(position = 'fill') using geom_text()
body: <p>after quite some time searching through SO, I did not find an example that solved my question:</p>
  
  <p>How to label geom_bar(position = 'fill') using geom_text()?</p>
  
  <pre><code>mydf = data.frame(
    'sample' = sample(x = LETTERS[1:3], size = 111,replace = T),
    'category' = sample(x = 1:11, size = 111,replace = T)
  )
  
  
  mydf %&gt;% 
    group_by(sample) %&gt;%
    ggplot( aes(fill=sample, x=category)) + 
    geom_bar( position="fill" )
   # Does not work: +  geom_text(position='fill', aes(label = ..y..))
  </code></pre>
  
  <p>Intended outcome: label the % in the middle of the bars, as in the example (except that it shows the count, unlike needed in my case):
  <img src="https://ggplot2.tidyverse.org/reference/geom_text-18.png" alt="">
  from <a href="https://ggplot2.tidyverse.org/reference/geom_text.html" rel="nofollow noreferrer">https://ggplot2.tidyverse.org/reference/geom_text.html</a></p>
  
  <p>I guess the real question is what is "y" and "label" if I use geom_bar(position = 'fill'), </p>
  
  <p>I am confused by ggplot blending calculations (proportions per category) with visualization.</p>
  
  <p>Thanks!</p>