Image                package:IDPmisc                R Documentation

_D_i_s_p_l_a_y_s _t_h_e _D_e_n_s_i_t_y _o_f _P_o_i_n_t_s _i_n _a _S_c_a_t_t_e_r _P_l_o_t _b_y _C_o_l_o_r_s

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

     The density of points in a scatter plot is encoded by color.

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

     Image(x, y = NULL, pixs = 1, zmax = NULL, colramp = IDPcolorRamp,
           factors = c(FALSE, FALSE))

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

    x, y: Coordinates of points whose density is plotted. If 'x' ist a
          matrix or a data.frame, the first two column are used as x
          and y respectively. 'y' must be in this case NULL. 'x' and
          'y' may be numeric or factor variable.

    pixs: Size of pixel in x- and y-direction in [mm] on the plotting
          device. When 'x' and 'y' are numeric,  pixels are square.
          When 'x' and 'y' are factors or should be handled as factors 
          (see argument 'factors'), pixels are no longer square. The
          pixels are enlarged in the dimension in which the factors are
          displayed, so that the rectangular pixels are centered at the
          factor levels.

    zmax: Maximum counts per Pixel to be plotted. When 'NULL' the
          density in the scatter plot is encoded from 0 pixel to
          maximum number of pixels found. 'zmax' must be equal or
          larger than maximum counts found.

 colramp: Color ramp to encode the density of the points within a pixel
          by color.

 factors: Vector of logicals indicating whether 'x' and / or 'y' should
          be handled as factors  independently of their 'class'.

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

     Before calling 'Image' a plot must have been created by, e.g.,
     calling 'plot(x,y,type="n")'. This function ensures  by default
     that the pixel has the same size in x- and y-direction. As a
     drawback, pixels may be unequally spaced, when there are only very
     few distinct (integer) values in x- or y-direction. When this is
     the case, the corresponding dimension should be declared as
     factor. (cf. argument 'factors').


     A similar solution for plotting densities is realized in the
     package 'fields':   'image.count'. The main differences between
     the solution in 'IDPmisc' and 'fields' are the following: In
     'Image' the pixel size is defined in mm on the plotting device
     whereas in  'image.count' the number of pixels in x- and
     y-direction are defined. 'Image' works on ordinary plots whereas 
     'image.count' needs the special plotting function 'image.plot'. In
     addition, 'Image' also works with factors as x- and / or
     y-coordinates

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

     Maximum number of counts per Pixel found.

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

     Andreas Ruckstuhl, refined by Rene Locher

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

     'ipairs', 'ilagplot', 'ixyplot', 'image', 'image.count'

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

     x <- rnorm(10000)
     y <- rnorm(10000,10)
     plot(x+y,y,type="n")
     Image(x+y,y)
     abline(a=0,b=1)

     ##
     plot.default(iris$Species,iris$Petal.Width,
                  xlim=c(0.5,3.5),
                  type="n",axes=FALSE)
     axis(1,at=1:3,lab=levels(iris$Species))
     axis(2)
     Image(iris$Species,iris$Petal.Width,pixs=3)

     ## The above can be merged to
     ixyplot(iris$Species,iris$Petal.Width,pixs=3, minL.lab=10)

