0

before I ask the question, I just want to say that I have looked every thread in here and I tried every trick in the book, but the problem remains,its due to the fact that I have 75 attributes of my variable CODEETAB (the school id) that I am trying to display in the boxplot, it's rendering the visualisation of my plot extremely difficult, I tried to flip it coord_flip and change the increase the widths with this code :

ggplot(epl_data, aes(x=CODEETAB, y=moy_exam2, fill=factor(SEXE))) + 
geom_boxplot(widths=1)+ coord_flip(expand = TRUE, clip = "on") 

enter image description here

but as you can see

is there any why I could zoom in on it ?

thanks

user2161721
  • 164
  • 1
  • 2
  • 11

1 Answers1

0

Not sure if this is what you're looking for but...if you just want to view the graph better, have you tried to just print the plot wider?

ggsave("plot.png", width = 15, height = 8, units = "in", dpi = 300)

You can take off the coord_flip and rotate the x-labels with theme(axis.text.x = element_text(angle = 45)) (play with vjust and hjust)

eyy
  • 72
  • 7
  • thanks, but it is not the answer, I get the same thing with ggsave, the plots do not expland ! – user2161721 Jul 16 '21 at 10:35
  • I think its going to be hard to display 75 different values in a boxplot visualization (it'll look busy any way you do it). How were you hoping for it to look? – eyy Jul 16 '21 at 17:20
  • I just had to sacrifice the 70 , I only display 5, but I hoped someone would have a better way, how about a grid arranged in which the 75 are displayed say 7 after 7 in a 10 lines by 1 colomn grid ? is there a way to do it like this ? – user2161721 Jul 16 '21 at 19:39
  • 1
    Yah, if you have some sort of grouping you could easily use cowplot::plot_grid or facet_grid from ggplot if you have factors. plot_grid might be better if you just want to arbitrarily group together a few points. I've also heard of people mentioning patchwork recently but I haven't used it myself – eyy Jul 16 '21 at 21:30