

title {base}                                 R Documentation

_P_l_o_t _A_n_n_o_t_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n_:

     This function can be used to add labels to a plot.  Its
     first four principal arguments can also be used as
     arguments in most high-level plotting functions.  They
     must be of type `character' or `expression'. In the
     latter case, quite a bit of mathematical notation is
     available such as sub- and superscripts, greek letters,
     fractions, etc.

_U_s_a_g_e_:

     title(main = "", sub = "", xlab = "", ylab = "", ...)

_A_r_g_u_m_e_n_t_s_:

    main: The main title (on top) using font and size (char-
          acter expansion) `par("font.main")' and color
          `par("col.main")'.

     sub: Sub-title (at bottom) using font and size
          `par("font.sub")' and color `par("col.sub")'.

    xlab: X axis label using font and character expansion
          `par("font.axis")' and color `par("col.axis")'.

    ylab: Y axis label, same font attributes as `xlab'.

     ...: further graphical parameters (from `par').

_S_e_e _A_l_s_o_:

     `mtext', `text'; `plotmath' for details on mathematical
     annotation.

_E_x_a_m_p_l_e_s_:

     plot(cars, main = "")
     title(main = "Stopping Distance versus Speed")

     x <- seq(-4, 4, len = 101)
     y <- cbind(sin(x), cos(x))
     matplot(x, y, type = "l", xaxt = "n",
             main = expression(paste(plain(sin) * phi, "  and  ",
                                     plain(cos) * phi)),
             ylab = expression("sin" * phi, "cos" * phi),    # only 1st is taken
             xlab = expression(paste("Phase Angle ", phi)),
             col.main = "blue")
     axis(1, at = c(-pi, -pi/2, 0, pi/2, pi),
          lab = expression(-pi, -pi/2, 0, pi/2, pi))
     abline(h = 0, v = pi/2 * c(-1,1), lty = 2, lwd = .1, col = "gray70")

