dataset <- read.csv("pone.0342243.s001 (2).csv")
dataset$man_vs_other <- as.factor(dataset$man_vs_other)
library(ggplot2)


ggplot(dataset, aes(x = accommodation_attitudes, y = after_stat(density), fill = gender)) +
  geom_histogram(binwidth=2) +
  theme_minimal()+
  theme(legend.position = "bottom") ### Possible histogram but I think I'm going to use the violin plot instead

ggplot(dataset, aes(x = gender, y = accommodation_attitudes)) +
  geom_violin(fill = "darkblue", alpha = 0.4, trim = FALSE, width = 1) +
  geom_boxplot(width = 0.1, alpha = 0.7)+
  labs(
    title="Distribution of ATRA Score by Gender",
    x = "Gender",
    y = "ATRA Score",
    subtitle = "Attitudes towards requesting accommodations by gender",
    caption = "Source: Christ, B. R., Malhotra, B., Chapman, O., Ertman, B., & Perrin, P. B. (2026). Visibility data. PLOS ONE."
  )+
  theme_bw()+
  scale_x_discrete(labels = c("Non-binary/non-conforming", "Man", "Other", "Transman", "Transwoman", "Woman"))+
   theme(axis.text.x = element_text(size = 10,face = "bold" ),
        text = element_text(family="Times New Roman"))

library(ggbeeswarm)

ggplot(dataset,aes(x=man_vs_other, accommodation_attitudes, color = man_vs_other)) +
  geom_beeswarm(alpha = 0.5)+
  labs(
    title="Distribution of ATRA Score by Gender",
    x = "Gender",
    y = "ATRA Score",
    subtitle = "Attitudes towards requesting accommodations by gender",
     caption = "Source: Christ, B. R., Malhotra, B., Chapman, O., Ertman, B., & Perrin, P. B. (2026). Visibility data. PLOS ONE."
  )+
  theme_bw()+
  theme(legend.position = "none")+
  scale_x_discrete(labels = c("Man", "Non-man"))+
   theme(axis.text.x = element_text(size = 10,face = "bold" ),
        text = element_text(family="Times New Roman")) +
   scale_color_manual(values = c("darkblue","maroon"))