Questions tagged [rastervis]

rasterVis is an R package providing functions and methods to visualize the raster data.

85 questions
1
vote
1 answer

Out of bound colour scale plot in raster

I have a raster and I want to plot it using image(). So far, I plotted the raster with my own color scale col. ## read the libraries library(raster) library(fields) library(grDevices) ##random raster object set.seed(1) r <- raster(ncol=5,…
user3978632
  • 283
  • 4
  • 17
1
vote
0 answers

Odd Number plots using levelplot and rasterVis

I'm using the rasterVis package and the levelplot function to plot seven rasters on a single plot. Here is the layout I'm going for: correct layout I've achieved this using the following…
em.d.kear
  • 33
  • 8
1
vote
1 answer

scale bar and north arrow in rasterVis plot in R

I am using rasterVis package in R for plotting raster data (mostly satellite data in tif format). I will be grateful, if I could get some advice on adding scalebar and north arrow. Any in built-functions available in this package? Thanks in advance.
Rakhesh
  • 11
  • 2
1
vote
1 answer

Change background colour when plotting categorical data in rasterVis using levelplot

I have a categorical data (lulc) for a land use land cover having 6 classes. I am trying to plot this data using levelplot in rasterVis l<-as.factor(lulc) rat <- levels(l)[[1]] rat[["landcover"]] <- c("Agriculture", "Bare land", "Built-up",…
rar
  • 894
  • 1
  • 9
  • 24
1
vote
1 answer

Subscript/superscript characters in rasterVis::levelplot strip labels

Can we include subscript/superscript characters in rasterVis::levelplot strip labels? Consider the following RasterStack, s: library(rasterVis) s <- stack(replicate(2, raster(matrix(runif(9), 3)))) The default plot method for Raster* objects allows…
jbaums
  • 27,115
  • 5
  • 79
  • 119
1
vote
1 answer

Match color with numbers Raster Map R

I would like to match color to raster class. Assume I have the following colors and these rasters: library(rasterVis) mycolors=c("darkred","red3", "orange", "yellow", "lightskyblue", "royalblue3","darkblue") s <- stack(replicate(6,…
code123
  • 2,082
  • 4
  • 30
  • 53
1
vote
1 answer

Remove white space from levelplot plotting Google map

I'm trying to get rid of some white space produced by levelplot in the rasterVis package. I'm using the dismo package to get a Google map, then using levelplot to plot it. However, there is a thin strip of white around the map. How do I remove…
user13317
  • 451
  • 3
  • 13
1
vote
1 answer

add flat polygon to rasterVis

I would like to create a figure that combines 3D bathymetric grided data (sea) with a 2D polygon (land). For example, in such a plot (http://chenangliu.info/en/wp-content/uploads/2014/02/wireframe.jpg) I would like to add a flat surface to the…
Wave
  • 1,216
  • 1
  • 9
  • 22
0
votes
0 answers

Add north arrow and scale in levelplot outside the plot

I plotted five grids A-E as a Raster Brick with the levelplot function. To do this, I added a north arrow and a scalebar. I would like to have a north arrow and scalebar for all grids outside the plot. Can anyone help? Would be great, when the x and…
User123
  • 1
  • 1
0
votes
0 answers

{lattice} subplots appear tilted

I am trying to plot multiple .nc files in R using level plot. I have plotted the data but the plots are titled a bit it seems. I tried with different layouts but the layout is still titled to an angle. I also tried to change the height and width of…
0
votes
2 answers

Overlaying shapefile over multiple raster plots in R

I have multiple NetCDF data and I need to plot only one component of each data. I have achieved this in plotting all the data. But now I am unable to overlay my shapefile over the plots created. Is there any way to overlay the shapefile over the…
0
votes
1 answer

gplot throws unable to find an inherited method for function ‘gplot’ for signature ‘"missing"’ with RasterBrick

I followed this answer to create raster files for each attribute in a shapefile and got a RasterBrick at the end. But when I try to plot it using gplot or ggplot2, it throws an error. I tried reading the file again and then stacking it, but the…
Ray
  • 56
  • 1
  • 7
0
votes
1 answer

Manage subplots titles in multiple (rasterVis) levelplot

I would like to merge multiple levelplots into one (using rasterVis package). I succeded in doing so with c() (see reprex). However, I cannot find a way to manage the titles of subplots. Specifically, only the top row plots get the right title while…
Luca d.
  • 11
  • 2
0
votes
0 answers

Plot background map from tiff file and add additional points

How do I plot a background map from a .tif file and then add points on top of the map from a different dataframe? Since there are quite a lot of points I would also like to add a second colour gradient for improved visibility, and this is where I am…
Nui
  • 101
  • 1
  • 6
0
votes
0 answers

overlap monocoloured raster layers using level plot in R

I am trying to overlap four raster layers using level plot, I seem to have it all good but the raster just does not show up in the graph, any hint? require(raster) library(rasterVis) r <- raster(nrows=10, ncols=10) p = CRS("+proj=longlat…
Agus camacho
  • 868
  • 2
  • 9
  • 24