title: R: Plotting a grid of values
body: <p>I have this simple reproducible code that generates some values: </p>
  
  <pre><code>total=0
  X=1
  for(i in 1:3){
  Y=0.1
  index=1
  index1=1
  value=0
  values=0
  for(i in 1:15){
    value[[index]]=10+X*Y+i
    if(index%%5==0){
      values[[index1]]=mean(value)
      index1=index1+1;
      index=0
      value=0
      Y=Y+1
    }
    index=index+1;
  }
  total=c(total,values)
  X=X+1
  }
  total=total[-1]
  </code></pre>
  
  <p>For </p>
  
  <p><code>X=1</code> and <code>Y=0.1</code> it generates <code>13.1</code></p>
  
  <p><code>X=1</code> and <code>Y=1.1</code> it generates <code>19.1</code></p>
  
  <p><code>X=1</code> and <code>Y=2.1</code> it generates <code>25.1</code></p>
  
  <p><code>X=2</code> and <code>Y=0.1</code> it generates <code>13.2</code></p>
  
  <p><code>X=2</code> and <code>Y=1.1</code> it generates <code>20.2</code></p>
  
  <p><code>X=2</code> and <code>Y=2.1</code> it generates <code>27.2</code></p>
  
  <p><code>X=3</code> and <code>Y=0.1</code> it generates <code>13.3</code></p>
  
  <p><code>X=3</code> and <code>Y=1.1</code> it generates <code>21.3</code></p>
  
  <p><code>X=3</code> and <code>Y=2.1</code> it generates <code>29.3</code></p>
  
  <p>So then I get in total 9 values, what I want to do is to plot them in a grid. It should be something like this or similar:</p>
  
  <p><a href="https://i.stack.imgur.com/GTHSS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GTHSS.png" alt="gridOfValues"></a></p>
  
  <p>The X can be at the top or bottom it doesn't matter or the Y, and I want to color them so that the small values have a lighter color and the bigger values a darker one. </p>
  
  <p>Is there any way to do this plot in R? I would very much appreciate any hint. I don't really know how to do it in the simplest way. I can plot an empty grid but I don't know how add the lines and values. Is there maybe any package that does something similar quickly? </p>
  
  <p>Or if anyone could suggest me another type of plot where I could plot X and Y with their values. </p>
  
  <p>I would very much appreciate any suggestion. </p>