-1

i'm quite new in R. I try to made geom point plot of my data (experimental dataset for sexuological research). The data structure has 392 obs. and 5 var. Variables are:

med_type(1:6), gen_type(1:17), quest_type ("Arosal", "Plesure", "Aesthetics", "Imagination"), mean_m2 (mean), SD_m2 (sd).

I did these plot:

ggplot(sum_tra_heterot_m, aes(x = gen_type , y = mean_m2)) +
  geom_point(aes(shape=as.factor(gen_type), color=as.factor(med_type)), size=2, position = position_dodge(width = 0.3))+
  scale_shape_manual(values=c(1:17),
                     name = "Genre_type",
                     breaks = c(1:17),
                     labels = c("hetero woman on top", "hetero Missionary", "hetero Doggy", "hetero Fellation",
                                "hetero Cunnilingus", "homo Fellation", "homo anal sex", "homo Cunnilingus",
                                "lesbian sex", "men masturbation", "woman masturbation", "naked woman",
                                "naked men", "men erection", "kissing", "detail of penetration",
                                "detail of genital"))+
  scale_color_manual(values=c('#ff0000','#e9ff00', '#32ff00', '#00ffff', '#4300ff', '#ff00fa'),
                     name = "Medium_type",
                     breaks = c(1:6),
                     labels = c("Foto","Sculpture","Painting","Graphic","Shunga","Hentai")) +
  ggtitle("Men - mean_of_evaluation_by_genre&medium_and_type_of_question") +
  theme(legend.position="bottom")+
  facet_wrap(~ quest_type, labeller = labeller(quest_type = labeller_names_2)
             )

Here is the result:

here is result.

the problem is that the individual "med_type" are arranged vertically and often overlap. Would it be possible to fold them horizontally side by side? Like here:

in these boxplot

camille
  • 16,432
  • 18
  • 38
  • 60
Eischias
  • 25
  • 5
  • 1
    Please [see here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) about how to post an R question that folks can answer, such as by including a sample of your data, not just a description of its variables. – camille May 28 '18 at 15:22

1 Answers1

1

you can try like this:

   ggplot()   + 
      geom_bar(data=sum_tra_heterot_m,  aes(x = gen_type , y = mean_m2, fill =  as.factor(med_type) ) ,
               stat = 'identity', position = 'dodge', alpha = 0.7) +
      faced_wrap(~as.factor(gen_type), ncol = 2)
karen
  • 822
  • 1
  • 6
  • 22