0

I have two raster files (raster1 and raster2). Each raster file has probability value (0-1). What I want to do is to create a stacked barplot for each raster (my probability classes should be: 0.1-0.2,0.2-0.4,0.4-0.6,0.6-0.8,0.8-1.0) and plot them next to each other.

Thank you for your help.

89_Simple
  • 3,393
  • 3
  • 39
  • 94
  • 1
    Please provide a [reproducible example] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and what you've already tried (and what's not working) for your problem – Heroka Aug 12 '15 at 13:30

1 Answers1

0
g1=hist(getValues(raster1), breaks=c(0.1,0.2,0.4,0.6,0.8,1),plot=F)
g2=hist(getValues(raster2), breaks=c(0.1,0.2,0.4,0.6,0.8,1),plot=F)
barplot(rbind(g1,g2))
aaryno
  • 606
  • 5
  • 13