简体   繁体   中英

How to get rid or alter default axis labels and/or titles in density plot?

我想知道,如何在R中的密度图中更改“默认”x标签(或副标题)。例如,我不会将此文本“N = ...,bandwidth = ...”改为开启情节(我不知道它是x标签还是副标题,但它通常出现在x轴下)。

You should just use the standard plotting arguments to change the labels:

plot(density(rnorm(10)), 
     xlab="X", #Change the x-axis label
     ylab="Density", #y-axis label
     main="A nice title")#Main title

See the plotting help page: ?plot and the documentation .

To get rib of them, simply specify them as NA

plot(density(rnorm(10)), 
xlab=NA, #Change the x-axis label
ylab=NA, #y-axis label
main=NA) #Main title

在绘图函数中,将ann = FALSE或单独的par函数

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