I am utilising ggplot2
within R to create barplot visualisations.
I have two variable columns:
Strength
(75 observations) sorted from highest to lowestRank
- The corresponding rank (1 being the highest, 75 being the lowest) of the above strength value
I have plotted these variables within a bar graph to show the distribution of strength values from highest to lowest ranked.
However, I am having difficulty with some of the bars being of different widths. I am using the following code:
a <- ggplot(data = mydata, aes(y = Strength, x = Rank))
a + geom_bar(stat="identity", width = .75, fill = "grey75") +
theme(axis.text.x = element_text(angle = -270, colour="black", vjust=.5),
axis.title.x = element_blank(), axis.title.y = element_blank(),
axis.ticks.y = element_blank(), axis.ticks.x = element_blank(),
axis.text.y = element_blank(), panel.background = element_blank()) +
geom_text(aes(label = floor(Strength)),angle = -270, hjust = -.1)
This returns the following image:
As you can see the bars at particular locations are wider for some reason. Is there anyway I can fix this? I have played around with the position functions to no avail.