piechart                package:base                R Documentation

_P_i_e _C_h_a_r_t_s

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

     Draw a pie chart.

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

     piechart(x, labels=names(x), shadow=FALSE,
             edges=200, radius=0.8, fill=NULL, main=NULL, ...)

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

       x: a vector of positive quantities. The values in `x' are
          displayed as the areas of pie slices.

  labels: a vector of character strings giving names for the slices.

  shadow: a logical vector indicating whether a shadow effect should be
          attempted for the chart. This only makes sense if the slices
          are filled with colors.

   edges: the circular outline of the pie is approximated by a polygon
          with this many edges.

  radius: the pie is drawn centered in a square box whose sides range
          from -1 to 1. If the character strings labeling the slices
          are long it may be necessary to use a smaller radius.

     col: a vector of colors to be used in filling the slices.

    main: an overall title for the plot.

     ...: graphical parameters can be given as arguments to `piechart'.

_N_o_t_e:

     Pie charts are a very bad way of displaying information. The eye
     is good at judging linear measures and bad at judging relative
     areas.

     A bar chart or dot chart is a preferable way of displaying this
     type of data.

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

     `dotplot'.

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

     piechart(rep(1,24), col=rainbow(24), radius=0.9)

     pie.sales <- c(0.12, 0.3, 0.26, 0.16, 0.04, 0.12)
     names(pie.sales) <- c("Blueberry", "Cherry",
         "Apple", "Boston Cream", "Other", "Vanilla Cream")
     piechart(pie.sales,
         col=c("purple", "violetred1", "green3",
         "cornsilk", "cyan", "white"))
     piechart(pie.sales,
         col=gray(seq(0.4,1.0,length=6)))

