title: ggplot 2 heatmap with varing axis
body: <p>I want to draw a heatmap, but the size of units on the x (and y) Axis should vary. Here an example code:</p>
  
  <pre><code>users = rep(1:3,3)
  Inst = c(rep("A",3),rep("B",3),rep("C",3))
  dens = rnorm(9)
  n_inst = c(3,3,3,2,2,2,1,1,1)
  df &lt;- data.frame( users, Inst, dens, n_inst )
  
  1     1    A  1.2521487      3
  2     2    A -0.1013088      3
  3     3    A  1.5770535      3
  4     1    B  1.1093957      2
  5     2    B  1.1059166      2
  6     3    B  0.6884662      2
  7     1    C -0.3864710      1
  8     2    C -1.0216373      1
  9     3    C  0.4500778      1
  
  z &lt;- ggplot(df, aes(Inst, users)) + geom_tile(aes(fill = dens))
  z + scale_x_discrete(breaks = n_inst)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8pxck.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8pxck.png" alt="enter image description here"></a>
  So this draws a heatmap, but all units of <code>Inst</code> have the same size. I want <code>A</code> to be 3 times the width of <code>C</code> and <code>B</code> two times the width of <code>C</code>. So I want <code>n_inst</code> to give the width of units.</p>
  
  <p>I tried scale_discret, but that doesn't do it</p>
  
  <p>Thank you in advance.</p>