1

I have a data whose value ranges between (Min = -3.686638e+18, Max= 1.647103e+17). I want a plot where the values below zero (0) should be shown in one color while the values above zero (0) to (1.647103e+17) should be divided into 15 classes (colors/hue). I tried plot, levelplot and spplot but unable to achieve the task. Data

> library (raster)
> DAM <- raster("data.tif")
> plot(DAM,col=rev(heat.colors(8, alpha = 1)) ,zlim=c(-6.3913e+17,  5.1913e+16))
> levelplot(DAM,labels = list(at = seq(-6.3913e+17,  5.1913e+16, 1.70E+16)))
> spplot(DAM,labels = list(at = seq(0,  5.1913e+16, 1.70E+16))

How to achieve the goal?

Dipu
  • 123
  • 2
  • 14
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. – MrFlick Jan 13 '20 at 15:52
  • It's done. kindly check – Dipu Jan 13 '20 at 17:37

1 Answers1

2

I am able to plot but not satisfying results can be seen. It's because most of my value are within a close range seen in frequency plot. I dnt know how to plot with such discrete data.

> plot(DAM, 
+      breaks = c(0,  1e+15, 0.647103e+16, 1e+16, 1.647103e+16, 2e+16, 2.6e+16, 5e+16,8e+17, 9e+17,10e+17), col = rev(heat.colors(8, alpha = 1)))

enter image description hereenter image description here

enter image description here

Dipu
  • 123
  • 2
  • 14