adjust axis with categorical variables

I am using following data from git: data

library(readr)       
library(curl)
library(ggpubr)    
data <- read_csv("https://raw.githubusercontent.com/fivethirtyeight/data/master/candy-power-ranking/candy-data.csv")
ggplot(data, aes(x=reorder(competitorname, pricepercent), y=pricepercent)) + 
#geom_segment(aes(xend=reorder(competitorname, pricepercent), yend=0)) +
#geom_point() +
geom_bar(stat="identity", width=.3) + 
coord_flip()+
theme_bw()

The y axis of the plot is very confusing. How can I stretch it so that the axis is clear and there is enough space in the axis for each competition name so that nothing overlaps?
Screenshot 2022-11-19 124800

i run the same code but i got this after expanding it .. seems good :slight_smile:

you can add this line to save the plot, than play with width, height and dpi to achieve the best result
ggsave("plot.png", width = 4000, height = 5000, units = "px", dpi = 800)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.