Hi, does anyone know how to make this kind of shade plots, to represent the data matrix?Thanks!


SP=c(Anthozoa,Buccinanops monilifer,Olivella puelcha,Crepidula sp.,Olivancillaria auricularia Olivancillaria urceus,Adelomelon sp.,Notocochlis isabelleana ,Bostrycapulus aculeatus Epitoniidae,Halistylus columna,Pareuthria atrata,Mitrella moleculina,Tegula sp.,Pleuromeris zelandica,Parvanachis paessleri,Eucallista purpurata,Ostreidae,Leiosolenus patagonicus,Crassinella marplatensis)
Sites=c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30)
Abundance=c(20 0 0 0 0 0 0 680 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 340 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 360 0 0 0 0 0 0 0 0 0 0 0 0
40 0 0 0 0 0 0 160 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 0 20 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 140 0 0 0 0 0 0 0 0 0 0 0 0
0 0 20 0 0 0 0 80 0 0 0 0 0 0 0 0 0 0 0 20
0 0 0 0 0 0 0 60 0 0 0 0 0 0 0 0 0 0 0 0
0 0 20 0 0 0 0 420 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 520 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 540 0 0 0 0 0 0 0 0 0 0 0 0
0 0 20 0 0 0 0 1340 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0
0 0 0 0 0 0 0 0 0 40 20 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 20 0 80 0 0 0 0 0 100
0 0 0 0 0 0 0 20 0 0 0 0 0 80 0 0 0 0 0 380
0 0 20 0 0 0 0 20 0 0 0 60 0 20 0 0 0 0 0 80
0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 0 20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 60 0 0 0
0 0 0 0 0 0 0 0 0 0 980 0 0 0 0 0 0 0 0 60
0 0 0 0 0 0 0 0 0 0 1440 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 380 0 0 0 0 0 0 0 0 20)

Here is a very rough version of a tile plot that, I think, will get you what you want.

library(ggplot2)
#invent data
DF <- expand.grid(LETTERS[1:15], letters[1:10])
DF$Value <- runif(150, min = 0, max = 30)
head(DF)
#>   Var1 Var2      Value
#> 1    A    a 27.1544457
#> 2    B    a 16.0830211
#> 3    C    a  0.4957402
#> 4    D    a 24.2278128
#> 5    E    a 29.5344831
#> 6    F    a 24.6242165
#Plot as tiles
ggplot(DF, aes(x = Var1, y = Var2, fill = Value)) + 
  geom_tile() + 
  scale_fill_gradient(low = "grey90", high = "grey10")

Created on 2023-05-03 with reprex v2.0.2

2 Likes

Thanks @FJCC !! I`ll try to do it

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.