scgradient              package:ggplot              R Documentation

_S_c_a_l_e: _c_o_l_o_u_r _g_r_a_d_i_e_n_t

_D_e_s_c_r_i_p_t_i_o_n:

     Scale a continuous variable along a colour gradient.

_U_s_a_g_e:

     scgradient(plot = .PLOT, low='red', mid='white', high="black", midpoint=0, range=c(NA,NA))

_A_r_g_u_m_e_n_t_s:

    plot: plot object to add scale to

     low: colour at low end of scale

     mid: colour at middle of scale

    high: colour at top of scale

midpoint: definition of midpoint

   range: range to scale data to

_D_e_t_a_i_l_s:

     This scale creates a continuous colour gradient from the low
     colour to the mid colour to high colour, as defined in the
     arguments.

_A_u_t_h_o_r(_s):

     Hadley Wickham <h.wickham@gmail.com>

_S_e_e _A_l_s_o:

     'sccolour'

_E_x_a_m_p_l_e_s:

     p <- scgradient(ggplot(movies, aes=list(x=mpaa, y=rating)))
     ggjitter(p, list(colour=rating))
     ggjitter(p, list(colour=length))
     p <- ggjitter(p, list(colour=rating))
     scgradient(p, low="yellow")
     scgradient(p, high="green", midpoint=5)

