add value to title in plot r code example
Example 1: how to add a text box in plot r
plot(1:10, 1:10,
main="text(...) examples\n~~~~~~~~~~~")
text(4, 9, expression(hat(beta) == (X^t * X)^{-1} * X^t * y))
text(7, 4, expression(bar(x) == sum(frac(x[i], n), i==1, n)))
Example 2: change the font of the title in a plot in r
x<-1:10; y<-x*x
plot(x,y, main = "", xlab="", ylab="",
col.axis="blue", type="l")
title(main = "Main title", sub = "Sub-title",
xlab = "X axis", ylab = "Y axis",
cex.main = 2, font.main= 4, col.main= "red",
cex.sub = 0.75, font.sub = 3, col.sub = "green",
col.lab ="darkblue"
)