scaleZoom             package:ifultools             R Documentation

_Z_o_o_m _i_n _o_n _a _s_p_e_c_i_f_i_e_d _r_e_g_i_o_n _o_f _a _d_a_t_a _m_a_t_r_i_x

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

     Returns the portion of a matrix based on the specified ranges of
     abscissa (x) and ordinate (y) values.

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

     scaleZoom(x, y, z=NULL, zoom=NULL, logxy="y",
         xy.linked=FALSE, xlab="x", ylab="y", log.base=2)

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

       x: a numeric vector of abscissa values corresponding to the
          provided 'z' matrix.

       y: a numeric vector of ordinate values corresponding to the
          provided 'z' matrix.

log.base: the base of the logarithm used to scale the output zoomed
          coordinates. See the help for the 'logxy' input for more
          details. Default: 2.

   logxy: a character string indicating containing either or both of
          the characters '"x"' and '"y"'. If the character '"x"' is
          present in the string, the logarithm of the resulting zoomed
          'x' coordinate is returned use base 'log.base'. A similar
          logic follows for the presence of character '"y"' in the
          string. For example, to take the log10 of both the zoomed x-
          and y-coordinates, one would set 'logxy="xy", log.base=10'.
          If logarithms are used, the 'xlab' and 'ylab' strings are
          altered accordingly. Default: '"y"'.

    xlab: character string defining x-label. Default: '"x"'.

xy.linked: a logical value. If 'TRUE', the algorithm used to define the
          output (zoomed) x- and y-coordinates as follows:

          _1 Let ix be the indices of 'x' s.t. 'x[ix]' is on the
               interval ['zoom[1]','zoom[2]'].

          _2 Redefine 'x' and 'y' as 'x=x[ix]' and 'y=y[ix]'.

          _3 Let iy be the indices of 'y' s.t. 'y[iy]' is on the
               interval ['zoom[3]','zoom[4]'].

          _4 Redefine 'x' and 'y' as 'x=x[iy]' and 'y=y[iy]'.

          Thus, both x- and y-zoom conditions must be met for both
          coordinates. Default: 'FALSE'.

    ylab: character string defining x-label. Default: '"y"'.

       z: a matrix of numeric values whose x- and y-axis values are
          defined by the 'x' and 'y' vectors, respectively. This
          argument may be 'NULL' signifying that no 'z' matrix is
          present and (in this case) only the zoomed 'x' and 'y'
          coordinates will be returned in the output. Default: 'NULL'.

    zoom: a four-element numeric vector containing the ranges to zoom
          into the data in 'c(xmin, xmax, ymin, ymax)' format. Default:
          NULL (no zoom).

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

     a named list containing the following components:

       x: The zoomed portion of the input 'x' vector.

       y: The zoomed portion of the input 'y' vector.

       z: The zoomed portion of the input 'z' matrix, if 'z' is not
          'NULL'.

      ix: The indices of the original 'x' vector which span the range
          specified by 'zoom[1:2]'.

      iy: The indices of the original 'y' vector which span the range
          specified by 'zoom[3:4]'.

    xlab: A character string defining an appropriate x-label for the
          zoomed x-coordinate output.

    ylab: A character string defining an appropriate y-label for the
          zoomed y-coordinate output.

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

     'image', 'stackPlot'.

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

     ## create an image 
     x <- y <- seq(-4*pi, 4*pi, len=50)
     r <- sqrt(outer(x^2, y^2, "+"))
     z <- cos(r^2)*exp(-r/6)
     image(x,y,z,col=gray((0:32)/32))

     ## zoom in on one portion of that image and 
     ## re-display 
     zoom <- scaleZoom(x,y,z, zoom=c(-5,5,-1,10), logxy="")
     image(zoom$x, zoom$y, zoom$z, col=gray((0:32)/32))

