简体   繁体   中英

plot without border (like hist) in r

If you call function hist on r, you will note that the box that usually surrounds plotting region doesn't appear, instead, only rulers indicating plot scale appear on the bottom and on the left. If you use r a lot you may probably have noticed this already. my question is: there is some graphical parameter or workaround to make this happen on any other plot of basic r (like in a scatterplot, a line plot, a qq plot or whatever)?

The only parameter I found was axes , but setting it to FALSE makes it disappear not only the box, but also the rulers.

You are looking for box() .

op <- par(mfrow=c(1, 2))

hist(mtcars$mpg, sub="w/o box")

hist(mtcars$mpg, sub="w/ box")
box()  ##  <-- this

par(op)

在此处输入图像描述

the answer is bty graphical parameter:

 x= matrix(rnorm(100), ncol= 2)
 plot(x, bty= 'n')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM