panel.violin             package:lattice             R Documentation

_P_a_n_e_l _F_u_n_c_t_i_o_n _t_o _c_r_e_a_t_e _V_i_o_l_i_n _P_l_o_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     This is a panel function that can create a violin plot.  It is
     typically used in a high-level call to 'bwplot'.

_U_s_a_g_e:

     panel.violin(x, y,
                  box.ratio = 1,
                  horizontal = TRUE,
                  varwidth = FALSE,
                  alpha, border, lty, lwd, col,
                  ...)

_A_r_g_u_m_e_n_t_s:

    x, y: numeric vector or factor. Violin plots are drawn for each
          unique value of 'y' ('x') if 'horizontal' is 'TRUE' ('FALSE') 

box.ratio: ratio of height of a violin and inter violin space 

horizontal: logical. If FALSE, the plot is `transposed' in the sense
          that the behaviours of x and y are switched. x is now the
          `factor'. See documentation of 'bwplot' for a fuller
          explanation. 

alpha, border, lty, lwd, col: graphical parameters controlling the
          violin.  Defaults are taken from the '"bar.fill"' settings. 

varwidth: logical. If 'FALSE', the densities are scaled separately for
          each group, so that the maximum value of the density reaches
          the limit of the allocated space for each violin (as
          determined by 'box.ratio').  If 'TRUE', densities across
          violins will have comparable scale. 

     ...: arguments passed on to 'density'. 

_D_e_t_a_i_l_s:

     Creates Violin plot of 'x' for every level of 'y'. Note that most
     arguments controlling the display can be supplied to the
     high-level (typically 'bwplot') call directly.

_A_u_t_h_o_r(_s):

     Deepayan Sarkar Deepayan.Sarkar@R-project.org

_S_e_e _A_l_s_o:

     'bwplot', 'density'

_E_x_a_m_p_l_e_s:

     bwplot(voice.part ~ height, singer,
            panel = function(..., box.ratio) {
                panel.violin(..., col = "transparent",
                             varwidth = FALSE, box.ratio = box.ratio)
                panel.bwplot(..., fill = NULL, box.ratio = .1)
            } )

