colorpanel              package:gplots              R Documentation

_G_e_n_e_r_a_t_e _a _s_m_o_o_t_h_l_y _v_a_r_y_i_n_g _s_e_t _o_f _c_o_l_o_r_s

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

     'colorpanel' generate a set of colors that varies smoothly.
     'redgreen', 'greenred', 'bluered', and  'redblue' generate
     red-black-green, green-black-red, red-white-blue, and
     blue-white-red colorbars, respectively. colors

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

     colorpanel(n, low, mid, high)
     redgreen(n)
     greenred(n)
     bluered(n)
     redblue(n)

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

       n: Desired number of color elements in the panel.

low, mid, high: Colors to use for the Lowest, middle, and highest
          values. 'mid' may be ommited.

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

     The values for 'low, mid, high' can be given as color names
     ('red'), plot color index (2=red), and HTML-style RGB,
     ("#FF0000"=red). 

     If 'mid' is supplied, then the returned color panel will consist
     of 'n - floor(n/2)' HTML-style RGB elements which vary smoothly
     between 'low' and 'mid', then between 'mid' and 'high'. Note that
     if 'n' is even, the color 'mid' will occur twice at the center of
     the sequence.

     If 'mid' is omitted, the color panel will vary smoothly beween
     'low' and 'high'.

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

     Vector of HTML-style RGB colors.

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

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

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

     'colors '

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

     showpanel <- function(col)
     {
       image(z=matrix(1:100, ncol=1), col=col, xaxt="n", yaxt="n" )
     }

     par(mfrow=c(3,3))

     # two colors only:
     showpanel(colorpanel(8,low="red",high="green"))

     # three colors
     showpanel(colorpanel(8,"red","black","green"))
     # note the duplicatation of black at the center, using an odd
     # number of elements resolves this:
     showpanel(colorpanel(9,"red","black","green"))

     showpanel(greenred(64))
     showpanel(redgreen(64))
     showpanel(bluered(64))
     showpanel(redblue(64))

