enter image description here

How can I add/display scale to two marginal plot?

RAD1998.all <- stack(list.ras)

list.files <- mixedsort(list.files(paste(getwd(), "/1998bil/", sep = ""), full.names = F, pattern = ".asc.bil")) 

outlist <- substr(list.files, 31, 43)

  • I'm not convinced that this question is better asked here rather than at Stack Overflow (meta.gis.stackexchange.com/questions/1961/…) but if you think GIS SE, can you edit your question to provide some details about how you think this relates to GIS, please? Disclaimer: I do not work with R. – PolyGeo Aug 10 '14 at 23:48
  • It could be a non GIS question but I am looking for a solution from RasterVis and two marginal plot gives lots of raster information. I wish if scale is added either or both sides then it will be easy to quantify raster data. All I want is that is there anyway I can add scale ? – Nahm Aug 11 '14 at 0:05
  • More efficient to directly ask the author – user32309 Aug 11 '14 at 2:35
  • That's good idea. – Nahm Aug 11 '14 at 3:09
  • It is not yet implemented. I will try to find a solution. – Oscar Perpiñán Aug 17 '14 at 8:20

I have committed changes in the repository that implement the axis.

Use this code to install the latest development version:

## install.packages("devtools")
devtools::install_github("rastervis", "oscarperpinan")

Then, use the new argument axis.margin to enable the axis.

 f <- system.file("external/test.grd", package="raster")
 r <- raster(f)
 levelplot(r, axis.margin = TRUE)

enter image description here

  • My raster data is a NEXRAD rainfall data in inches per 5 min. Most of my raster cell values are less than 0.1"/5 min. – Nahm Aug 21 '14 at 17:14
  • First of all thanks a lot. It worked beautifully. I don't know how attach an image file at a "Add Comment". axis.margin worked fine with overlaying shape files demonstrated in your github, oscarperpinan.github.io/rastervis/FAQ.html#sec-7. It's so beautiful. Thanks, Nahm – Nahm Aug 21 '14 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.