-4

I would like to create a heat map as in the figure. In the web, there are many examples of heat maps, but their data are 3-dimensional. the map in my mind

My data size is 318,2. I have calculated error values of two different methods. Column 1 is method 1 and column 2 is method 2. Row values are errors. It looks like that

Station No Method-1 Method-2
01|01      10.5     14.1
01|02      8.2      9.6
.
.
.
05|318     8.7      9.4

In the heat map, I would like to put stations in y-axis. I am also open different kind of plot suggestions.

Reiso
  • 133
  • 1
  • 13
  • Please read this on how to provide a good reproducible example: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. Also think about the examples you provided and what constitutes the x, y dimension of the heatmap... what are the 2 values incorporated into your `Station` variable? – Djork Oct 27 '17 at 02:28
  • Sorry, but what is the point of reproducing this question? I am not asking a fix or anything about a problem in the code. To my understanding, reproduction should be necessary to reproduce a problem. – Reiso Oct 27 '17 at 02:33
  • 3
    @Reiso - then you're putting the responsibility on the answerer to make example data to test their code. Why would the answerer bother if you can't? – thelatemail Oct 27 '17 at 03:03

1 Answers1

0

Here is the answer

library(lattice)

t<-matrix(your_list[1:315],nrow=21,ncol=15) # didnt tried with other types data.frame or else
levelplot(t,pretty=T,col.regions=rev(heat.colors(315)))

The output is heat map only 1

2 images can be added on one page with any tool.

Community
  • 1
  • 1
Reiso
  • 133
  • 1
  • 13