smartlegend              package:gplots              R Documentation

_P_l_a_c_e _a _l_e_g_e_n_d _i_n _a _s_p_e_c_i_f_i_e_d _l_o_g_i_c_a_l ("_t_o_p","_b_o_t_t_o_m", "_l_e_f_t",
"_r_i_g_h_t", _e_t_c) _l_o_c_a_t_i_o_n _o_n _a _p_l_o_t.

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

     This function places a legend in a specified logical
     ("top","bottom", "left", "right", etc) location on a plot.

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

     smartlegend(x = c("left", "center", "right"),
                 y = c("top", "center", "bottom"),
                 ..., inset = 0.05)

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

       x: horizontal location on the plot.  One of "left", "center" or
          "right".

       y: vertical location on the plot.  One of "top", "center", or
          "bottom".

     ...: arguments for 'legend'

   inset: inset distance from the margin as a fraction of the plot
          region.

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

     Same as 'legend'

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

     Gregory R. Warnes gregory.r.warnes@pfizer.com

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

     'legend'

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

     x <- rnorm(100)
     y <- rnorm(100, x^2 )
     plot(x,y)
     abline( lm(y~x), col="red", lty=1, type="b") # regression fit
     lines( lowess(y~x), col="blue", lty=2, type="b") # lowess fit

     smartlegend(x="center", y="top",
                 c("Regression","Locally Linear Smooth"),
                 col=c("red","blue"), lty=1:2)

