'Removing the white bar in barplot with ggplot2
Im trying to remove the white bar on the right of this barplot, but i cannot understand how. Here is the graph:

Here is the code i used:
library(ggplot2)
ggplot(data = df2, aes(x=`neighbourhood`, y="1", fill=`room_type`)
geom_bar(position="fill", stat="identity") +
coord_flip() +
scale_fill_brewer(palette = 14) +
labs(title = "Tipi di stanze per quartiere", y = "Quantità", x = "Quartiere", fill = "Tipo di stanza")
Solution 1:[1]
Try removing the y = "1" and the stat = "identity", like this:
library(ggplot2)
ggplot(data = df2, aes(x=`neighbourhood`, fill=`room_type`)
geom_bar(position="fill") +
coord_flip() +
scale_fill_brewer(palette = 14) +
labs(title = "Tipi di stanze per quartiere", y = "Quantità ", x = "Quartiere", fill = "Tipo di stanza")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Lucca Nielsen |
