Let's say I have a table like this:
Category = c(1, 2, 1,2,1,2,3)
Bucket = c("A", "A", "B","B","C","C","C")
Fill = rnorm(7)
df = data.frame(Category,Bucket,Fill)
Category | Bucket | Fill
---------| ------ | -----
1 | A | 0.7
2 | A | 0.8
1 | B | 0.9
2 | B | 0.5
1 | C | 0.4
2 | C | 0.3
3 | C | 0.5
ggplot(data=df, aes(x=Bucket,y=Category))+
geom_tile(aes(fill= Fill))+
theme(axis.text.y=element_blank())
And the heatmap is not a square. The height for bucket C
is higher than bucket B
and bucket A
.
How can I adjust so that each bucket will have the same height?