myPalette                package:GLAD                R Documentation

_M_i_c_r_o_a_r_r_a_y _c_o_l_o_r _p_a_l_e_t_t_e

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

     This function returns a vector of color names corresponding to a
     range of colors specified in the arguments.

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

     myPalette(low = "white", high = c("green", "red"), mid=NULL, k =50)

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

     low: Color for the lower end of the color palette, specified using
          any of the three kinds of R colors, i.e., either a color name
          (an element of 'colors'), a hexadecimal string of the form
          '"#rrggbb"', or an integer 'i' meaning 'palette()[i]'.

    high: Color for the upper end of the color palette, specified using
          any of the three kinds of R colors, i.e., either a color name
          (an element of 'colors'), a hexadecimal string of the form
          '"#rrggbb"', or an integer 'i' meaning 'palette()[i]'.

     mid: Color for the middle portion of the color palette, specified
          using any of the three kinds of R colors, i.e., either a
          color name (an element of 'colors'), a hexadecimal string of
          the form '"#rrggbb"', or an integer 'i' meaning
          'palette()[i]'.

       k: Number of colors in the palette.

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

     A "character" vector of color names. This can be used to create a
     user-defined color palette for subsequent graphics by 'palette',
     in a 'col=' specification in graphics functions, or in 'par'.

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

     Sandrine Dudoit, Yee Hwa (Jean) Yang.

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

     'palette', 'rgb', 'colors', 'col2rgb', 'image', 'ColorBar',
     'arrayPlot'.

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

     par(mfrow=c(1,4))
     pal <- myPalette(low="red", high="green")
     ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
     pal <- myPalette(low="red", high="green", mid="yellow")
     ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
     pal <- myPalette()
     ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
     pal <- myPalette(low="purple", high="purple",mid="white")
     ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)

