contourLines            package:grDevices            R Documentation

_C_a_l_c_u_l_a_t_e _C_o_n_t_o_u_r _L_i_n_e_s

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

     Calculate contour lines for a given set of data.

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

     contourLines(x = seq(0, 1, length.out = nrow(z)),
                  y = seq(0, 1, length.out = ncol(z)),
                  z, nlevels = 10,
                  levels = pretty(range(z, na.rm=TRUE), nlevels))

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

     x,y: locations of grid lines at which the values in 'z' are
          measured.  These must be in ascending order.  By default,
          equally spaced values from 0 to 1 are used.  If 'x' is a
          'list', its components 'x$x' and 'x$y' are used for 'x' and
          'y', respectively. If the list has component 'z' this is used
          for 'z'.

       z: a matrix containing the values to be plotted ('NA's are
          allowed).  Note that 'x' can be used instead of 'z' for
          convenience.

 nlevels: number of contour levels desired *iff* 'levels' is not
          supplied.

  levels: numeric vector of levels at which to draw contour lines.

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

     'contourLines' draws nothing, but returns a set of contour lines.

     There is currently no documentation about the algorithm. The
     source code is in 'R_HOME/src/main/plot3d.c'.

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

     A list of contours. Each contour is a list with elements: 

  level : The contour level.

      x : The x-coordinates of the contour.

      y : The y-coordinates of the contour.

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

     'options("max.countour.segments")' for the maximal complexity of a
     single contour line.

     'contour'.

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

     x <- 10*1:nrow(volcano)
     y <- 10*1:ncol(volcano)
     contourLines(x, y, volcano)

