hboxplot               package:hexbin               R Documentation

_2-_D _G_e_n_e_r_a_l_i_z_a_t_i_o_n _o_f _B_o_x_p_l_o_t

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

     If 'bin' is an _eroded_ 'hexbin' object, i.e., an 'erodebin'
     object, 'hboxplot()' plots the high counts cells selected by
     'erode()'.  By default, the high counts cells contain 50 percent
     of the counts so analagous to the interquartile "range".  The
     function distinguishes the last cells eroded using color.  These
     cells correspond to one definition of the bivariate median.

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

     hboxplot(bin, xbnds = NULL, ybnds = NULL,
              density, border = c(0, grey(0.7)), pen = c(2, 3),
              unzoom = 1.1, clip ="off", reshape = FALSE,
              xlab = NULL, ylab = NULL, main = "")

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

     bin: an object of class 'hexbin'.

xbnds,ybnds: global x- and y-axis plotting limits for multiple plots.

density, border: arguments for 'polygon()' each of length two, the
          first for the median, the second for the other cells.

     pen: colors ("pen numbers") for 'polygon()'.

  unzoom: plot limit expansion factor when 'xbnds' is missing.

    clip: either 'on' or 'off' are the allowed arguments, when on
          everything is clipped to the plotting region.

 reshape: logical value to reshape the plot although 'xbnds' and
          'ybnds' are present.

xlab, ylab, main: x- and y- axis labels and main title

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

     The 'density', 'border', and 'pen' arguments correspond to the
     'polygon' function calls for plotting two types of cells.  The
     cell types, pen numbers and suggested colors are

       TYPE                                     PEN  COLOR
       cells of bin                             2    light gray
       last eroded cells of bin (median cells)  1    black

     The erode components of the hexbin objects must be present for the
     medians cells to plot.

     When 'xbnds' is missing or 'reshape' is true, the plot changes
     graphics parameters and resets them.   When 'xbnds' is missing the
     function also zooms in based on the available data to provide
     increased resolution.

     The zoom used the hexagon cell centers.  The unzoom argument backs
     off a bit so the whole hexagon will fit in the plot.

     'Hboxplot()' is used as a stand alone function, for producing
     separate legends .....

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

     invisibly, the 'hexViewport()' used internally. Used to add to the
     plot afterwards.

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

     see in 'grid.hexagons'.

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

     'hexbin', 'erode', 'hcell2xy', 'gplot.hexbin', 'grid.hexagons',
     'grid.hexlegend'

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

     ##  boxplot of smoothed counts
     x <- rnorm(10000)
     y <- rnorm(10000)

     bin <- hexbin(x,y)
     erodebin <- erode(smooth.hexbin(bin))

     hboxplot(erodebin)
     hboxplot(erodebin, density = c(32,7), border = c(2,4))
     hp <- hboxplot(erodebin, density = c(-1,17),
                    main = "hboxplot(erode*(smooth*(.)))")
     pushHexport(hp)
     grid.points(x[1:10], y[1:10])# just non-sense to show the principle
     popViewport()

