rasterVis is an R package providing functions and methods to visualize the raster data.
Questions tagged [rastervis]
85 questions
3
votes
1 answer
Plotting a raster with exponential or quantile color ramp diverging around zero
I am using the R function levelplot() from the rasterVis package to plot a stack of three rasters with a single diverging color ramp. I would like to change the scale of a raster color ramp so that the map accentuates differences in lower values.…

Cotton.Rockwood
- 1,601
- 12
- 29
3
votes
1 answer
Elegantly combining continuous and factor rasters
When plotting a mixture of continuous and factor rasters with rasterVis::levelplot using print(..., more=TRUE), the height and width of the panels is inconsistent. This seems to be due to differences in the width of the colorkey (legend), and the…

jbaums
- 27,115
- 5
- 79
- 119
3
votes
1 answer
Displaying multiple 3d plots in the same window using plot3D {rasterVis} in R
I am interested in making two 3d topographic plots that display side by side in the same Xquartz device window. Displaying two 3d plots in the same window is straightforward using the rgl package - there are plenty of examples in the documentation…

TPegan
- 33
- 3
2
votes
0 answers
vectorplot show the error message "subset.default(sa, 1) : 'subset' must be logical"
I have been running the following code in RStudio for testing vectorplot functionality in R:
library(raster)
library(rasterVis)
library(lattice)
proj <- CRS('+proj=longlat +datum=WGS84')
df <- expand.grid(x=seq(-2, 2, .01), y=seq(-2, 2, .01))
df$z…

Prateek Verma
- 21
- 2
2
votes
0 answers
loading raster image in tiff format in R
I am trying to load raster image which is in tiff formate in Rstudio. For this I used code
#library (raster)
#library (sp)
#library (rgdal)
#library (tiff)
#wd <- ("E:\\phd\\data\\calliberation test\\rstudio")
#setwd(wd)
#NTL1997F12 <-…

Heena
- 21
- 2
2
votes
0 answers
Overlap in labels of point data in rasterVis
I have a raster r, one polygon shapefile regions and a point shapefile cities. I need to plot all three into one map layout. In addition to this I need to label point file with names of cities (cities$city$Town.Name) and their temperature and…

rar
- 894
- 1
- 9
- 24
2
votes
1 answer
Specifying color of NA raster values in levelplot (R package rasterVis)
How can I assign a specific color to NA values of a raster when plotting it with the levelplot function from R-package rasterVis? I am searching for a similar functionality as "colNA".

Christopher Stephan
- 1,081
- 16
- 33
2
votes
2 answers
How to remove background gray color when using gplot method in Rastervis?
Does any one knows that ,how to remove background gray color when using gplot method in Rastervis? I already try to remove the theme color but it did not work.
r <- raster(system.file("external/test.grd", package="raster"))
s <- stack(r,…

Bingwei Tian
- 73
- 5
1
vote
1 answer
Strange 3D output from rasterVis::plot3D when plotting a digital elevation model
I'm trying to plot a few 3D digital elevation models using rasterVis::plot3D.
The DEMs are originally geo tifs, they are all DEMs of the same location just different areas in that location and they all have the same coordinate reference system…

Krystal Randall
- 13
- 5
1
vote
0 answers
How to make x and y tick labels to be printed as geographic coordinates in levelplot in R?
I am trying to make a point raster plot using "levelplot". I want my x and y tick labels to be printed as Geographic coordinates (e.g. 101°W, 100°W, ...34°N, 35°N, etc.)
Following is the test data and code I tried so…

raghav
- 533
- 2
- 11
1
vote
2 answers
rasterVis - setting the bottom plots in the middle with levelplot
I am using the awesome rasterVis to create a panel with maps that have the same extent (i.e. same spatial coverage) but that show different features (i.e. each with its own legend).
This is what it looks like so…

thiagoveloso
- 2,537
- 3
- 28
- 57
1
vote
1 answer
Density plot of raster stack
I would like to realize a density plot of raster stack using the package rasterVis in R-CRAN.
I would like to change the colors with which the distribution of my raster values is represented and also add a legend. Is it possible to do these things…

matt85
- 49
- 1
- 7
1
vote
1 answer
Organizing raster plot in R using rasterVis and gridExtra
I am having a tough time plotting maps together in R using rasterVis and gridExtra. This is how my code looks like (sorry, it is certainly not elegant):
require(rasterVis)
require(gridExtra)
p1 <- levelplot(avit_bac12, margin=FALSE, xlab=NULL,…

TWest
- 765
- 2
- 6
- 27
1
vote
2 answers
Modify existing R Color Brewer palette
library(raster); library(rasterVis); library(RColorBrewer)
I want to change the 'Brown Green' theme so that the middle break (140 to 160) is gray.
Is that possible?
Here's an example with the volcano data set.
breaks <- c(100, 120, 140, 160, 180,…

derelict
- 3,657
- 3
- 24
- 29
1
vote
1 answer
How to plot out of bound raster color scale with a specific color in image R?
I have a raster and I want to plot the out of bound color with a specific color in image plot. The code I have so far
## read the libraries
library(raster)
library(fields)
library(grDevices)
##random raster object
set.seed(1)
r <- raster(ncol=5,…

user3978632
- 283
- 4
- 17