Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

r

label

subtitle

I would like to know, how can I alter "default" x label (or subtitle) in density plot in R. For example, I do not wand this text "N = ..., bandwidth = ..." to be on the plot (I do not know if it is x-label or subtitle, but it usually appears under x-axis).

like image 221
Oleksandr Avatar asked Apr 24 '12 07:04

Oleksandr


1 Answers

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.

like image 161
csgillespie Avatar answered Sep 18 '22 02:09

csgillespie