0

Hello everyone I was trying to make a plot in r and i got it but then I had the problem that the name of the bar plots are enclosed so do anyone know how to avoid this problem.

This is my code

ggplot(question2, aes(x=educa, fill=X_incomg)) + geom_bar(position = "fill")+ 
   ylab("Proportion") + 
  ggtitle("Reported education vs. Income categories") +
  scale_fill_brewer("Income level", palette="Set2") +
   theme_bw()

Plot

  • 1
    To rotate labels you could use: `+ guides(x = guide_axis(angle = 90)`? – Quinten Jan 27 '23 at 15:23
  • 2
    Lots of options for dealing wiht long labels here: https://www.andrewheiss.com/blog/2022/06/23/long-labels-ggplot. What exactly do you want to do for your plot? It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jan 27 '23 at 15:24

0 Answers0