0

Here is my code:

ggplot() +   labs(x = "Age", 
       y = 'Frequency', 
       title = "Histogram comparison between real and synthetic data") + 
  geom_histogram(aes(r_data)) + 
  stat_function(fun = dnorm, 
                geom = "area", 
                color = 'white',
                fill = "lightgrey", 
                alpha = 0.2) + 
  geom_histogram(aes(region_sum_stats$mean_age), 
                 color = 'white', 
                 fill = 'steelblue', 
                 alpha = 0.8)

These are the histograms:

enter image description here

I'd love some help on this!

Thanks in advance!

stefan
  • 90,330
  • 6
  • 25
  • 51
sKenny1
  • 1
  • 1
  • 1
    Does this help? https://stackoverflow.com/questions/3695497/show-percent-instead-of-counts-in-charts-of-categorical-variables – AdroMine Sep 12 '22 at 07:31

0 Answers0