getMarginWidth            package:plotrix            R Documentation

_F_i_n_d _t_h_e _m_a_r_g_i_n _w_i_d_t_h _n_e_c_e_s_s_a_r_y _t_o _f_i_t _t_e_x_t _o_r _a _l_e_g_e_n_d _n_e_x_t _t_o _a _p_l_o_t.

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

     Calculates the margin width necessary to fit text or a legend next
     to a plot.

_U_s_a_g_e:

      getMarginWidth(side=4,labels,is.legend=FALSE)

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

    side: Which side of the plot (as in axis).

  labels: The text to place next to the plot.

is.legend: Whether the text is in a legend or not.

_D_e_t_a_i_l_s:

     'getMarginWidth' reads parameters about the current plot and
     calculates the left or right (default) margin necessary to fit the
     strings passed as  'labels' or a legend containing those strings.

_V_a_l_u_e:

     A two element list containing the number of margin lines necessary
     to fit the text or legend and the horizontal center of the margin
     in user units.

_A_u_t_h_o_r(_s):

     Jim Lemon

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

      plot(rnorm(10))
      getMarginWidth(labels=c("Long label","Even longer label"))

