how do i plot three different continuous factors based on a dataset in one graph not using barplots

The three different factors for example estimated salary, max salary and min salary, I have tried using add=true, although there are no errors it doesnt work

So I only want to combine these three plots into one: ggplot(freshGrad, aes(Estimated_Salary)) + geom_histogram(fill="sienna1") + theme_economist() + labs(x="Estimated Salary for Job Postings", y="Job Posting Frequency", title="IT Specialization Job Postings by Estimated Salary", subtitle = "Does Estimated Salary affect Job Postings?")

ggplot(freshGrad, aes(Min_Salary)) + geom_histogram(fill="purple") + theme_wsj() + labs(x="Min Salary for Job Postings", y="Job Posting Frequency", title="IT Specialization Job Postings by Min Salary", subtitle = "Does Min Salary affect Job Postings?") ggplot(freshGrad, aes(Max_Salary)) + geom_histogram(fill="cadetblue") + theme_fivethirtyeight() + labs(x="Max Salary for Job Postings", y="Job Posting Frequency", title="IT Specialization Job Postings by Max Salary", subtitle = "Does Max Salary affect Job Postings?") from this data set

the title does not need to be included in the combined graph i just want to be able to combine the plots into one perhaps like an overlay

It is really confusing to understand based on the codes that you have. I am not sure you are plotting something else and the axis titles are something else.

Below is an example that shows how you can plot histograms in one plot.

#### Overlay histogram
library(tidyverse)
dat <- data.frame(Salary1 = c(runif(100,20,50)), Salary2= runif(100,40,80),salary3=runif(100,0,30))

dat[1:10,]
#>     Salary1  Salary2   salary3
#> 1  28.40532 42.16858  2.117457
#> 2  37.89075 72.98922 23.202403
#> 3  41.46119 72.64916  2.122423
#> 4  46.79879 41.42893 13.562715
#> 5  35.59396 49.78160  8.891214
#> 6  36.92400 58.40501 13.788198
#> 7  48.80460 73.43966 10.475883
#> 8  28.87504 46.90564 15.714000
#> 9  27.25362 78.46885 16.797786
#> 10 20.21194 53.07976 19.291227

ggplot(reshape2::melt(dat),aes(x=value, fill = variable))+geom_histogram()
#> No id variables; using all as measure variables
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

[image]

Created on 2021-03-25 by the reprex package (v1.0.0)
image

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.