Questions tagged [rastervis]

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

85 questions
0
votes
1 answer

Add arrows to levelplot

I would like to add some arrows to a categorical raster plot. Using Base R (on a non-ratified raster) as an example: r <- raster(nrow=10, ncol=10, crs='+proj=utm +zone=1') r[] = 1 r[51:100] = 3 r[3:6, 1:5] = 5 plot(r) arrows(100, 50, 0, 50,…
Simon
  • 991
  • 8
  • 30
0
votes
1 answer

plot spatial data from irregular grid

I would like to use the rasterVis package to plot contours of spatial data (e.g. using levelplot as in this example). However, the dataset comes from a NetCDF file with an irregular grid, as below: lon(y,x) lat(y,x) var(y,x) and there is no…
Andrea
  • 1
0
votes
1 answer

How to add logo on levelplot?

I want to make a plot from raster data using levelplot. How to add a header which contains logo.png and title, like showed on this picture? Here is my data: SST Here is my basic code to produce this map: r<-crop(raster(flname, varname="sst"),…
Eko Susilo
  • 250
  • 2
  • 15
0
votes
0 answers

Difference generating image between .Rmd and .R

The code below is a full .Rmd file that successfully generates a .pdf file with a hovmoller plot of surface temperature. (I apologize for pasting the whole file, but it is short and I'm not sure what might be causing the problem - though I believe…
jbtg
  • 21
  • 2
0
votes
1 answer

R remove whitespace between levelplot grobs

I have a plot with rasterVis::levelplots above other rasterVis::levelplots. There is too much whitespace between them. How do I trim the whitespace? MWE library(raster) library(rasterVis) library(gridExtra) ## Raster Setup r <- raster::raster(…
Jordan
  • 455
  • 6
  • 21
0
votes
2 answers

rasterVis::levelplot Title Height

How do I change the vertical space between the raster and the title in a levelplot in R? For example, for an extra 2 lines of space I have tried r <- raster::raster( matrix(runif(9),3,3) ) rasterVis::levelplot(r, margin=FALSE, main=list('My…
Jordan
  • 455
  • 6
  • 21
0
votes
1 answer

Join Multiple R Rastervis levelplots

I have two rasterstacks, each with a common legend, that I want to put on a single plot with a space in between stacks. I want the raster images to be the same size within each block and across blocks. Is there an easy way to do this using…
Jordan
  • 455
  • 6
  • 21
0
votes
1 answer

Plotting raster with just 2 pixels using levelplot function in "rasterVis" package in R

I am trying to plot the following raster using the levelplot function in the "rasterVis) package, but all this gives me is a straight line. I tried to give different breaks to the legend using the "at"command but to no avail. I tried whatever I…
0
votes
1 answer

Clipping of raster as a shapefile in r

I want to clip a raster using shapefile in r as a shape of shapefile. I used crop function but it clipping as extents not as a shape. Please help me
Satya Chandra
  • 728
  • 2
  • 12
  • 26
0
votes
1 answer

Exporting rasterVis plot without border

I am trying to export rasters from the rasterViz package as jpg or png. I am struggling to: completely trim white border keep transparency for NAs So far: library(raster) library(rasterVis) # Toy Data m <- …
freds
  • 1
  • 3
0
votes
0 answers

R levelplot adjust colour scale

I am trying to adjust my colour scale on a level plot using the rasterVis package. My code plots a raster. I am using manually set colour scale that classifies that data into 5 quantiles. I would like to have the labels stay at the values I have…
GreenlawM
  • 55
  • 1
  • 11
0
votes
1 answer

Overlay continent outlines on levelplot in R

I'm trying to overlap continent outlines on a layerplot, and would like to lable the x and y axes with longitude and latitude values. At the moment I don't get an error but no outlines appear. I am wondering if that is because I'm not defining the…
ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
0
votes
1 answer

levelplot plots the wrong categorical colours

I have received a .tif file alongside a .qml file containing information about the colour for each value (e.g. forest is green, clouds are black). library(raster) library(rasterVis) sm <- raster("UT_classification_coded.tif") ########## Classify…
pdx
  • 303
  • 7
  • 18
0
votes
2 answers

Move levelplot colorkey labels closer to colorkey

How can I move the colorkey lables closer to the colorkey? The labels for the color breaks are too far from the colorkey. I would like them very close to the colorkey. Any thoughts? …
code123
  • 2,082
  • 4
  • 30
  • 53
0
votes
1 answer

Short legend height in rastervis plot of categorical raster

In plotting categorical raster maps with levelplot, such as Josh O'Brien's answer here Legend of a raster map with categorical data, the legend height always become shorter. Is there a way to adjust the legend height the same height as the plot…
Ktelo
  • 5
  • 3