user4889553
user4889553

Reputation: 21

Plot basic graph with no borders, titles, etc

I want to make a plot which takes up the entire space; no borders, no scale bars, etc.

I tried:

sp.predict <- predict(tstack, sp.tree4, 
   n.trees=sp.tree4$gbm.call$best.trees, 
   type = "response")    
plot(sp.predict)

Which gives me the plot fine but has a border, blank space where the titles should go, etc. How can I get the plot to take up the entire space?

Upvotes: 1

Views: 51

Answers (1)

Ben Bolker
Ben Bolker

Reputation: 226097

Use par(mar=rep(0,4)), as shown in this example from ?plot.raster:

 require(grDevices)
 r <- as.raster(c(0.5, 1, 0.5))
 ## ... snip
 # fill page
 op <- par(mar=rep(0, 4))
 plot(r, asp=NA)
 par(op)

You may also want to add legend=FALSE ...

enter image description here

Upvotes: 1

Related Questions