1

I am having some issues when plotting rasters with the raster::plot function. It seems that my Rstudio's graphic device has some problem and the plots are just very very tiny. As of illustration, if the outcome of

raster::plot(raster::raster(matrix(1:100,10,10)))

is

enter image description here

whereas if plotting it on R application or through my Mac's terminal, the output is just perfect. This happens to any raster I try to plot. In both applications, my raster and sp packages version are the same (2.6-7 and 1.2-5, respectively).

I am running RStudio version 1.0.136 on a 64bit iMac (late 2015). The R version running is 3.3.2. My os is version 10.12.6 (macOS Sierra). Any thoughts?

This question follows up raster::plot() plotting raster too small- is there an alternative on ggplot?, where I thought the issue was the raster file.

3
  • Upgrade to R 3.4.x and the latest RStudio and try again
    – Spacedman
    Commented Dec 14, 2017 at 12:33
  • It actually did not work. Moreover, it happens to happen only in RStudio. Running the same code from R or from the Terminal, the plot comes out perfectly. Any thoughts? Commented Apr 27, 2018 at 11:52
  • Looks like Rstudio weirdness.... try community.rstudio.com
    – Spacedman
    Commented Apr 27, 2018 at 15:30

1 Answer 1

0

I had the same problem. I solved it by updating R AND by clicking on the Clear all Plots sign (a broom) in the plot window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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