0

I am plotting raster using plot, and the exported figure seems to be cut off in the right side. Part of the legend in the right side are missing.

jpeg("500.jpeg", units="cm", width = 10, height = 14, res=600)
names(fs1)=c("a", "b","c","d","e","f","g","h")
plot(fs1,axes = FALSE, box=FALSE,nc=2,nr=4,col=colorRampPalette(c("grey", "green", "blue"))(255))
dev.off() 

The result plot

Can you please let me know what might cause this issue and how can I fix it?

Also, I am wondering how to adjust the font size of the name on the top of each raster plot (i.e. a, b, c, ..., etc.)

Many thanks in advance.

benson23
  • 16,369
  • 9
  • 19
  • 38
Jie SU
  • 1
  • 1
  • The argument `cex` will do it. It's a percentage...1.5 = 150%, .5 = 50% of the original size. It looks like you're fairly new to SO; welcome to the community! Normally, if you want great answers quickly, it's best to make your question reproducible. This includes sample data like the output from `dput(head(dataObject)))` and any libraries you are using. Check it out: [making R reproducible questions](https://stackoverflow.com/q/5963269). – Kat Feb 28 '22 at 14:27
  • 1
    You can set the margins of a plot with `par(mar=)`, and create your own loop. `terra::plot` is more useful than `raster::plot` and it has an argument `mar`. Hard to help more without an example, so please create some data with code or use data that ship with R but do *not* use `dput` as that does not work with these data types (nor does it work well in most other cases). – Robert Hijmans Feb 28 '22 at 18:13

0 Answers0