Questions tagged [rastervis]

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

85 questions
10
votes
1 answer

multiple (rasterVis) levelplots

i'm quite desperate trying to adjust two levelplots of one rasterstack each on one plot. It seems like rasterVis::levelplot does not take the par(mfrow = c(...)) option for splitting the pane. An example using two rasterstacks that shall be arranged…
user3352417
  • 101
  • 1
  • 3
9
votes
5 answers

R Crop no-data of a raster

I would like to crop the no-data part of some rasters (example of the image in 1 where no-data is in black) without defining the extent manually. Any idea?
Wraf
  • 747
  • 2
  • 10
  • 24
8
votes
1 answer

Relassify continuous raster data into binned classes with discrete colors

I would like to: Reclassify the raster ras into nine classes using reclassify Provide a colorkey with values written beside each colour (see sample plot below). The colorkey should not be split, as in the sample plot, but rather shown as a single…
code123
  • 2,082
  • 4
  • 30
  • 53
7
votes
3 answers

Levelplot color key - range and extremes

Is it possible in R to create a color key like the one below? (this one comes from the software Grid Analysis and Display System - Grads). There are two features that I can't reproduce in R: The sequence is non linear however it is displayed as…
Fallen lord
  • 196
  • 1
  • 12
7
votes
1 answer

How to add text to a specific/fixed location in rasterVis levelplot

In fact, this question is consist of two questions targeting the same behaviour. How can I add text (varies by each panel) to a fixed location in panel area? I'm aware of panel.text and latticeExtra::layer solution but it adds text using plotting…
Sezen
  • 447
  • 1
  • 5
  • 17
7
votes
1 answer

Change raster panel titles using levelplot

I'm using RasterVis and levelplot to make a trellis plot of some rasters. I am currently ok for most things but I would like to change the header for each panel from the filename to a chosen string (the filename is convoluted and long, i want to use…
Sam
  • 1,400
  • 13
  • 29
7
votes
1 answer

Lattice full plot area

I want to delete R's default margin around the lattice plot. This means that I want to get rid of all the white spaces beyond the red rectangular. Here is the example: library (raster) library(rasterVis) f <- system.file("external/test.grd",…
Geo-sp
  • 1,704
  • 3
  • 19
  • 42
7
votes
1 answer

How to get RGB raster image with UTM coordinates

I have a three layer raster with red, green, and blue channel values in it. I can plot the image with raster::plotRGB, but I need to add axes with UTM coordinates. Coordinates can be added with axes=TRUE, but they are floating in space and look bad.…
klar
  • 146
  • 5
6
votes
0 answers

classify raster stack with levelplot (RasterVis)

i have a raster stack of 7 rasters with quite varying data ranges and not all of the rasters adhere to quite the same range. (some are low value ranges, some much higher). Using the levelplot function with the stack, it plots nicely enough, eg: r <-…
Sam
  • 1,400
  • 13
  • 29
5
votes
1 answer

Use animate() with series of levelplots in R raster

I have a time series of 25 yearly land cover rasters. As this is categorical data, I use levelplot(inputRaster) (part of the rasterVis library) to plot a single raster. However, I would like to sequentially plot the yearly rasters, as the animate…
Niels DB
  • 69
  • 4
5
votes
1 answer

Adding scale labels to levelplot's margins

I'd like to add label showing the values of latitudinal zonal averages to levelplot's gray margin. In the following example, the min and max values for latitudinal means are 286 and 751 respectively. Any suggestion on adding an axis with this…
Geo-sp
  • 1,704
  • 3
  • 19
  • 42
4
votes
1 answer

R plot raster colorscheme not full range

I am trying to plot a raster with a defined colour scheme, which I take from the Rcolorbrewer package, so far no problem. The raster´s value range from 0 to 1 with no NA´s. library(RColorBrewer) library(classInt) pal <- brewer.pal(n=50, name =…
a.urbanite
  • 75
  • 7
4
votes
1 answer

How to remove the box frame in “levelplot” in R package “rasterVis”

I want to remove the box frame in my "levelplot" figure for raster data sets. Don't know how to do it. library(raster) library(rasterVis) f <- system.file("external/test.grd", package="raster") r <- raster(f) s <- stack(r, r+500,…
Jian Zhang
  • 1,173
  • 5
  • 15
  • 20
3
votes
1 answer

How to reverse the deault color of RasterVis (Levelplot)?

I want to use the deault color of levelplot but in a reverse order. I know how to reverse custom colors but unable to do for default color of rasterVis.rasterVis library(raster) library(rasterVis) ##Solar irradiation data from CMSAF old <-…
Lalantra
  • 67
  • 1
  • 11
3
votes
2 answers

R - How to improve color shading of a RasterVis levelplot?

I am trying to improve the color shadings of a levelplot. Please take a look at the code below: # Load required packages library(raster) library(rasterVis) library(viridis) # Download…
thiagoveloso
  • 2,537
  • 3
  • 28
  • 57
1
2 3 4 5 6