

mtext {base}                                 R Documentation

_W_r_i_t_e _T_e_x_t _i_n_t_o _t_h_e _M_a_r_g_i_n_s _o_f _a _P_l_o_t

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

     `text' is written in one of the four margins (`side')
     of the plot.  `line' measures the distance outwardly in
     character size units.

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

     mtext(text, side = 3, line = 0, outer = FALSE, at = NULL, adj = NA, ...)

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

    text: character string to be written.

    side: on which side of the plot (1=bottom, 2=left,
          3=top, 4=right).

    line: on which MARgin line, starting at 0 counting out-
          wards.

   outer: use outer margins if available.

      at: give location in user-coordinates.  If
          `length(at)==0' (default), the location will cor-
          respond to `par("adj")'.

     adj: length = 1 or 2 : adjustment in x- (and optionally
          y-) direction.  If `adj' isn't finite (default), a
          default is setup, using `par("las")' (and not
          `par("adj")'!

     ...: Further graphical parameters; currently supported
          are:

     cex: character expansion factor (default = 1).

     col: color to use.

    font: font for text.

_S_i_d_e _E_f_f_e_c_t_s_:

     The given text is written onto the current plot.

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

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

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

     plot(1:10, (-4:5)^2, main="Parabola Points", xlab="xlab")
     mtext("10 of them")
     for(s in 1:4)
         mtext(paste("mtext(.., line= -1, {side, col, font} = ",s,
               ", cex = ", (1+s)/2, ")"), line = -1,
               side=s, col=s, font=s, cex= (1+s)/2)
     mtext("mtext(.., line= -2)", line = -2)
     mtext("mtext(.., line= -2, adj = 0)", line = -2, adj =0)
     ##--- log axis :
     plot(1:10, exp(1:10), log='y', main="log='y'", xlab="xlab")
     for(s in 1:4) mtext(paste("mtext(..,side=",s,")"), side=s)

