Dear friends, I want to draw the heat map as shown below：
But the two pictures obtained by using the following code are not very suitable.
ggplot(example.data, aes( x=date, y=scales, fill=DI) ) +
scale_fill_continuous(type = "viridis")+
labs(title = 'Fig.1')
d <- dcast(example.data, date ~ scales )
d <- d[,-1]
z= as.matrix(d), col = heat.colors(81),
The two figures obtained from the above code are as follows:
Please help me to find out what the problem is? Thank you very much!
Another question needs to be asked. How should I upload the data required by this code (the example.data is a data.table of 16152*3)?