Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

7
How can I rotate the X-axis labels in a ggplot bar graph?
Post Body

I'm using the following code to create a bar graph of 5 emotions (also below). I need to shrink the graph so that it can fit into a survey I am making for another study, but when I reduce the width of the graph, the x-axis labels start to overlap with each other. How can I rotate them to that I can squeeze the graph even more?

https://preview.redd.it/ur07pnk46fh21.png?width=1287&format=png&auto=webp&s=416d9645c0d5a21890d5bdb7a7f2d01b86d1ef1d

ggplot(TidyPolicyEmotionsTest, aes(Emotions, Ratings))

geom_hline(yintercept = 1:5) #adds lines at each reference point

geom_col(fill="steelblue")

labs(x="Emotions", y="Strength of Emotion")

ylim(0,5)

theme_classic()

After rotating the labels with theme(axis.text.x = element_text(angle = 45)) this happens...

https://preview.redd.it/ak0r7pbl8fh21.png?width=1383&format=png&auto=webp&s=d1403d9072fa3aef615113e710c0f4c2e5f1495b

How do I lower the labels?

Author
Account Strength
60%
Account Age
8 years
Verified Email
No
Verified Flair
No
Total Karma
1,398
Link Karma
614
Comment Karma
784
Profile updated: 5 days ago
Posts updated: 9 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 years ago