1

I want to combine these 2 graphs.

I want to see them in the same panel one on each other.

Plot 1 - shows the % of academics from the total job seekers.

Plot 2 - shows the % of woman seekers from the total job seekers. thanks for the help!

# PLOT 1
academic_plot <- ggplot(q1Subset, aes(MONTH, percAcademics)) +     
  geom_point(color="green") +                                    
  stat_smooth(method = "lm", formula = y ~ x, geom = "smooth") +   
  theme_minimal() + ggtitle("Percentage of Academic Seekers") + 
  ylab("Academic Seekers (%)") + 
academic_plot 

# PLOT 2
women_plot <- ggplot(q1Subset, aes(MONTH, percWomen)) +            
  geom_point(color="red") +
  stat_smooth(method = "lm", formula = y ~ x, geom = "smooth") +    
  theme_minimal() + ggtitle("Percentage of Women Seekers") +
  ylab("Women Seekers (%)")
women_plot
Tal Itach
  • 41
  • 4
  • 2
    https://stackoverflow.com/questions/1249548/side-by-side-plots-with-ggplot2 – rawr Jun 10 '22 at 20:19
  • 2
    What do you mean by combine them? Do you want them on the same page, side-by-side, one above the other, or have all the points and lines on the same panel? Whichever it is, you are more likely to get a helpful answer if you edit your question to include some data we can use to reproduce your plots. At the moment we can't see them, nor can we make them ourselves. – Allan Cameron Jun 10 '22 at 20:20
  • https://drive.google.com/drive/folders/16w-iQRUQOLeIG6mVto2ua5ojy__QAKCd?usp=sharing – Tal Itach Jun 10 '22 at 20:26
  • hey and thanks for your commant! i shared my code, the 2 graphs written in lines 94-110 – Tal Itach Jun 10 '22 at 20:28
  • could you please `dput()` your data! Google drive is not working! – TarJae Jun 10 '22 at 20:32
  • Hey @TarJae and thanks for your commant :) i'm new in this site, what does it mean dput()? – Tal Itach Jun 10 '22 at 20:37
  • 1
    What you should really consider is this . To learn about `dput()` type `?dput()` in your console. Otherwise it is always a guess (with no reproducible example)! – TarJae Jun 10 '22 at 20:40

1 Answers1

1

If you mean combining them on one grid, rawr's comment is helpful. However, if you mean combining them where you'd like to see a plot for the percentage of academic job seekers and highlighting the percentage of women, then I would suggest having one plot representing the percentage of academics from the total job seekers, and highlight that of women's with some colour. I cannot see your data, but I would assume there are percentages of men and women seekers. I would call it SeekersGender, and write the code below:

academic_plot <- ggplot(q1Subset, aes(MONTH, percAcademics)) +     
  geom_point(aes(colour = factor(SeekersGender))) +                                    
  stat_smooth(method = "lm", formula = y ~ x, geom = "smooth") +   
  theme_minimal() + ggtitle("Percentage of Academic Seekers") + 
  ylab("Academic Seekers (%)") + 
academic_plot 

This shall give each gender a certain colour and show a legend of the genders and their perspective colours, as well as highlight the women points of the academic seekers.

Archeologist
  • 169
  • 1
  • 11