Questions tagged [levelplot]

Levelplot is a command in the `lattice` graphics package for `r` that displays three dimensional data using a false-color gradient.

Levelplot is a command in the lattice graphics package for r that displays three dimensional data using a false-color gradient. The x and y data are plotted used to indicate position on the x- and y- axis. The z data is used to determine the color of that position. Note that the x and y coordinates are assumed to define a regular grid.

203 questions
15
votes
1 answer

How to rotate the x-axis labels 90 degrees in levelplot

I'm trying to visualize a correlation map, and I think that I've gotten it to work, except for the jumbling of the x-axis labels. Any suggestions for how to rotate them? Some of the parameters for many of the Base R plots don't seem available for…
Atticus29
  • 4,190
  • 18
  • 47
  • 84
10
votes
1 answer

How do I specify different color ranges for different levels?

I am making a lattice levelplot from x and y factors that range from [0,1]: x y level …
Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345
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
2 answers

Add XY points to raster map generated by levelplot

I have raster maps which are generated using the raster package in R. These raster layers can be visualized using the rasterVis package's levelplot function: levelplot(rasterstack, layout=c(1, 2), col.regions=colorRampPalette(c('darkred',…
code123
  • 2,082
  • 4
  • 30
  • 53
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
1 answer

Custom legend for lattice levelplot or ggplot2 map R

Given the code, map and sample data below: instead of plotting names of watersheds etc on the map,how can I produce a seperate legend using ggplot2or levelplot just like one will do using ArcGIS? Basically, I will like to produce the legend shown on…
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
6
votes
3 answers

Using patterns in addition/instead of background colors in lattice plots

I am using level plots from the R lattice package. My resulting plots look like the one shown below. My problem now is that I need to generate a black and white version for printing. Is there a way to change the colors to grayscale and give the…
Manuel
  • 6,461
  • 7
  • 40
  • 54
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
6
votes
3 answers

levelplot: how to add space between colorkey and x-axis label

I am trying to use levelplot to plot a simple Digital Elevation Model (DEM). Here is my code: r1 = raster("ned10dem.tif") e = extent(460000,480000,4555000,4567500) rr1 = crop(r1,e) p = levelplot(rr1,…
Dan
  • 352
  • 3
  • 11
6
votes
1 answer

R code doesn't save plot image

The following code produces an image: library(latticeExtra) x=runif(40) y=runif(40) z=runif(40) png(filename=paste(i,".png",sep="")) levelplot(z ~ x + y, panel = panel.levelplot.points, col.regions = rainbow(50)) dev.off() But the following code…
StanLe
  • 5,037
  • 9
  • 38
  • 41
6
votes
1 answer

R levelplot and interpolation

some days ago I managed to make levelplots, with interpolation, with the following command within a script: levelplot(jan~lon*lat,APM,main="Jan",panel=panel.levelplot.raster,interpolate=T) I accidentaly did not keep that session, only the script,…
Alex Caseiro
  • 403
  • 1
  • 4
  • 9
5
votes
1 answer

levelplot box line width R

Does any know how to change the line width of a levelplot graphic, especially that with multiple panels? The box line width should change alongside the tick marks. In base R one can use plot(x);box(lwd=10). Is this possible within levelplot? Many…
code123
  • 2,082
  • 4
  • 30
  • 53
1
2 3
13 14