0

gs %>% group_by(country) %>% ggplot(aes(x=country,y=`gdp_per_capita ($)`)) + geom_bar(stat='identity') + coord_flip()

How can I change the Y-axes so I can see the countries better enter image description here

JASTRIPE
  • 19
  • 2
  • 3
    Make your plot taller? I'm not sure exactly what you want. There's only so much text that can fit in such a small space. – MrFlick Dec 18 '19 at 16:19
  • There's too many countries for one static graph (without a scroller option). You could try `facet_wrap` function if you want to group the graphs by continent – Jonny Phelps Dec 18 '19 at 16:20
  • 1
    it would help if you use `dput` to post the aggregated data, check https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610 – Mouad_Seridi Dec 18 '19 at 16:20
  • 1
    You can make the font smaller (e.g., `... + theme_gray(base_size = 9)`), or you can make your plot bigger. Or you can change your plot. – Gregor Thomas Dec 18 '19 at 16:20
  • 1
    You could use `... + theme(axis.text.y=element_text(size=8))` to set the y axis font to a smaller size – Jonathan V. Solórzano Dec 18 '19 at 16:24

1 Answers1

0

You can set the character of xlabel more smaller,and set the height of the figure more bigger

yuanzz
  • 1,359
  • 12
  • 15
  • 1
    To make this answer as helpful as possible to future readers, could you post the actual code that would accomplish this? – A. S. K. Dec 19 '19 at 00:16