How to fix/adjust the width of each band in ggplot geom_tile
<p>Here is a sample data for my question:</p>

<pre><code>sampledata &lt;- matrix(c(1:60,1:60,rep(0:1,each=60),sample(1:3,120,replace = T)),ncol=3)
colnames(sampledata) &lt;- c("Time","Gender","Grade")
sampledata &lt;- data.frame(sampledata)
sampledata$Time &lt;- factor(sampledata$Time)
sampledata$Grade &lt;- factor(sampledata$Grade)
sampledata$Gender &lt;- factor(sampledata$Gender)
</code></pre>

<p>I am plotting an heatmap from this sample data using <code>geom_tile</code> </p>

<pre><code>color_palette &lt;- colorRampPalette(c("#31a354","#2c7fb8", "#fcbfb8", "#f03b20"))(length((levels(factor(sampledata$Grade)))))
ggplot(data = sampledata) + geom_tile( aes(x = Time, y = Gender, fill = Grade))+scale_x_discrete(breaks = c("10","20","30","40","50"))+scale_fill_manual(values =color_palette,labels=c("0-1","1-2","2-3","3-4","4-5","5-6","&gt;6"))+  theme_bw()+scale_y_discrete(labels=c("Female","Male"))
</code></pre>

<p>I got this graph:
<a href="https://i.stack.imgur.com/YDzkk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YDzkk.png" alt="enter image description here"></a></p>

<p>I want to adjust the width of Male and Female separately so that I get different widths for different gender.The meaning of width is shown in the following pic:
<a href="https://i.stack.imgur.com/XZ88B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XZ88B.png" alt="enter image description here"></a></p>

<p>Is it possible to do this by making changes to my current code? Thanks!</p>