squareplot              package:UsingR              R Documentation

_C_r_e_a_t_e _a _s_q_u_a_r_e_p_l_o_t _a_l_t_e_r_n_a_t_i_v_e _t_o _a _s_e_g_m_e_n_t_e_d _b_a_r_p_l_o_t

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

     Create a squareplot as an alternative to a segmented barplot.
     Useful when the viewer is interested in exact counts in the
     categories. A squareplot is often used  by the _New York Times_. A
     grid of squares is presented with each color representing a
     different category. The colors appear contiguously reading top to
     bottom, left to right. The colors segment the graph as a segmented
     bargraph, but the squares allow an interested reader to easily
     tally the counts.

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

     squareplot(x, col = gray(seq(0.5, 1, length = length(x))),
     border =NULL, nrows = ceiling(sqrt(sum(x))), ncols =
     ceiling(sum(x)/nrows),
     xlab = deparse(substitute(x)), main = NULL,
     ...)

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

       x: a vector of counts

     col: a vector of colors 

  border: border color passed to 'polygon'

   nrows: number of rows

   ncols: number of columns 

    xlab: label for x axis 

    main: main title

     ...: passed to 'plot.window'

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

     Creates the graph, but has no return  value.

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

     John Verzani

_R_e_f_e_r_e_n_c_e_s:

     The _New York Times_, <URL: www.nytimes.com>. In particular,
     Sports page 6, June 15, 2003.

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

     ## A Roger Clemens Cy Young year
     squareplot(c(21,7,6),col=c("blue","green","white"))

